Open
Conversation
spajic
approved these changes
Apr 14, 2019
| gem 'pg_query', '>= 0.9.0' | ||
| gem 'skylight' | ||
| gem 'activerecord-import' | ||
| gem 'strong_migrations' |
| disable_ddl_transaction! | ||
|
|
||
| def change | ||
| add_index :trips, [:from_id, :to_id], algorithm: :concurrently |
|
|
||
| def create_services | ||
| new_services = [] | ||
| all_services = Service.const_get('SERVICES').each_with_object({}) do |name, result| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Результаты оптимизации: ~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