1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails
Ryuta Kamizono 0908184e4c 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
```
2019-04-04 03:27:46 +09:00
..
api Generate Action Text's API docs 2019-01-04 23:56:22 -05:00
application Add config.disable_sandbox option to Rails console 2019-03-23 19:31:03 +09:00
command Properly expand the environment's name in all commands 2019-03-15 07:43:10 +09:00
commands Rename connection option to database in dbconsole command 2019-04-02 13:15:55 +09:00
console Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
engine Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
generators Use execute_batch2 rather than execute_batch to fix performance regression for fixture loading 2019-04-04 03:27:46 +09:00
plugin [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
rack Log the remote IP addr of clients behind a proxy 2018-07-31 20:45:37 +05:30
railtie Clarify that config.eager_load controls eager loading [ci skip] 2017-12-30 22:37:44 +00:00
tasks Add Channel tests to rails stats 2019-01-21 10:45:08 +00:00
templates Ruby can show a little bit more detailed info in shorter code 2018-12-15 13:21:58 +09:00
test_unit Add rails test:channels. 2019-01-16 16:34:34 +00:00
all.rb Import Action Text 2019-01-04 22:22:49 -05:00
app_loader.rb Railities typo fixes. 2019-02-01 16:42:40 +05:30
app_updater.rb Remove --skip-yarn in favor of --skip-javascript 2018-10-22 16:54:10 +03:00
application.rb Update comment for how secret key is calculated 2019-03-22 17:59:41 -07:00
application_controller.rb Always yield a CSP policy instance 2018-03-08 14:14:09 +00:00
autoloaders.rb moves a require to the file that needs it 2019-03-08 09:04:12 -08:00
backtrace_cleaner.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
cli.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
code_statistics.rb Enable Lint/UselessAssignment cop to avoid unused variable warnings (#34904) 2019-01-09 18:09:01 +09:00
code_statistics_calculator.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
command.rb Homogenize rails help output 2018-11-19 22:48:51 +01:00
commands.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
configuration.rb Turn on performance based cops 2018-07-23 15:37:06 -07:00
dev_caching.rb Make restart and dev:cache tasks work when customizing pid file path 2017-08-21 05:44:11 +09:00
engine.rb url -> URL where apt except inside actionpack/ 2019-04-01 22:56:35 +05:30
gem_version.rb Prep release 2019-03-11 11:58:15 -04:00
generators.rb Add rails db:system:change command 2019-01-09 14:23:25 -05:00
info.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
info_controller.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
initializable.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
mailers_controller.rb Use symbol for mail preview format, not string 2019-03-18 16:06:31 -07:00
paths.rb Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
rack.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
railtie.rb Fix call sites 2018-10-02 15:31:29 -04:00
ruby_version_check.rb Require Ruby 2.5 for Rails 6. 2018-12-19 21:47:50 +01:00
secrets.rb Remove usage of strip_heredoc in the framework in favor of <<~ 2018-02-16 19:28:30 -05:00
source_annotation_extractor.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
tasks.rb Make rake routes deprecate before deleting 2018-08-20 08:47:29 +09:00
test_help.rb Use testing lazy-load hooks: 2018-07-04 16:34:59 -04:00
version.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
welcome_controller.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00