Skip to content

Task 4 homework#8

Open
ArtsiomMusin wants to merge 3 commits intospajic:masterfrom
ArtsiomMusin:task_4_homework
Open

Task 4 homework#8
ArtsiomMusin wants to merge 3 commits intospajic:masterfrom
ArtsiomMusin:task_4_homework

Conversation

@ArtsiomMusin
Copy link

Результаты оптимизации: ~53 секунды для большого файла и чуть больше 1 секунды на рендеринг страницы.

rails reload_json[fixtures/large.json]
Finish in 53.08

siege -c2 -r20 http://localhost:3000/автобусы/Самара/Москва
** SIEGE 4.0.4
** Preparing 2 concurrent users for battle.
The server is now under siege...
Transactions: 280 hits
Availability: 100.00 %
Elapsed time: 21.10 secs
Data transferred: 25.34 MB
Response time: 0.15 secs
Transaction rate: 13.27 trans/sec
Throughput: 1.20 MB/sec
Concurrency: 1.99
Successful transactions: 280
Failed transactions: 0
Longest transaction: 1.15
Shortest transaction: 0.00

Copy link
Owner

@spajic spajic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

gem 'pg_query', '>= 0.9.0'
gem 'skylight'
gem 'activerecord-import'
gem 'strong_migrations'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

disable_ddl_transaction!

def change
add_index :trips, [:from_id, :to_id], algorithm: :concurrently
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Плюсик за concurrently


def create_services
new_services = []
all_services = Service.const_get('SERVICES').each_with_object({}) do |name, result|
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Service::SERVICES?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants