diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-04 03:19:08 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-04 03:27:46 +0900 |
commit | 0908184e4c2dca5b941030bbd0d5eb2dfcfed120 (patch) | |
tree | b66a18ff72fd898b5d6f5917836afe46c342acf2 /Gemfile.lock | |
parent | d39b2b684e94e856a4a1257984ff6a1d5f978a2c (diff) | |
download | rails-0908184e4c2dca5b941030bbd0d5eb2dfcfed120.tar.gz rails-0908184e4c2dca5b941030bbd0d5eb2dfcfed120.tar.bz2 rails-0908184e4c2dca5b941030bbd0d5eb2dfcfed120.zip |
Use `execute_batch2` rather than `execute_batch` to fix performance regression for fixture loading
d8d6bd5 makes fixture loading to bulk statements by using
`execute_batch` for sqlite3 adapter. But `execute_batch` is slower and
it caused the performance regression for fixture loading.
In sqlite3 1.4.0, it have new batch method `execute_batch2`. I've
confirmed `execute_batch2` is extremely faster than `execute_batch`.
So I think it is worth to upgrade sqlite3 to 1.4.0 to use that method.
Before:
```
% ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
Using sqlite3
Run options: -n test_eager_loading_too_may_ids --seed 35790
# Running:
.
Finished in 202.437406s, 0.0049 runs/s, 0.0049 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
ARCONN=sqlite3 bundle exec ruby -w -Itest -n test_eager_loading_too_may_ids 142.57s user 60.83s system 98% cpu 3:27.08 total
```
After:
```
% ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
Using sqlite3
Run options: -n test_eager_loading_too_may_ids --seed 16649
# Running:
.
Finished in 8.471032s, 0.1180 runs/s, 0.1180 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
ARCONN=sqlite3 bundle exec ruby -w -Itest -n test_eager_loading_too_may_ids 10.71s user 1.36s system 95% cpu 12.672 total
```
Diffstat (limited to 'Gemfile.lock')
-rw-r--r-- | Gemfile.lock | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 7617942267..b6b1aaf92d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,6 +278,7 @@ GEM image_processing (1.7.1) mini_magick (~> 4.0) ruby-vips (>= 2.0.13, < 3) + jar-dependencies (0.4.0) jaro_winkler (1.5.2) jaro_winkler (1.5.2-java) jdbc-mysql (5.1.46) @@ -468,9 +469,7 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) - sqlite3 (1.3.13-x64-mingw32) - sqlite3 (1.3.13-x86-mingw32) + sqlite3 (1.4.0) stackprof (0.2.12) sucker_punch (2.1.1) concurrent-ruby (~> 1.0) @@ -582,7 +581,7 @@ DEPENDENCIES sidekiq sneakers sprockets-export - sqlite3 (~> 1.3, >= 1.3.6) + sqlite3 (~> 1.4) stackprof sucker_punch turbolinks (~> 5) |