Actions
Patch #44569
openDisable Bullet (gem) unused eager loading detection in development
Status:
New
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
Description
Bullet (gem) unused eager loading detection makes pages that preload many records very slow in development. For example, in a project with about 4000 members, the project overview and the Log time page take several seconds or more (development mode, SQLite, response time measured with curl):
| Bullet enabled (current development default) |
Unused eager loading detection disabled (this patch) |
Bullet disabled (for reference) |
|
|---|---|---|---|
| Project overview | 10.2 s | 1.1 s | 0.45 s |
| Log time page | 16.5 s | 1.7 s | 0.29 s |
This detection runs after each request, and its cost grows with the square of the number of preloaded records. This is a known issue in Bullet (https://github.com/flyerhzm/bullet/issues/616), closed as stale without a fix.
The following patch disables only the unused eager loading detection. N+1 query detection, the main purpose of adding Bullet in #42555, and counter cache detection stay enabled.
diff --git a/config/environments/development.rb b/config/environments/development.rb
index d41e817f3d..ea7983d7fc 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -64,5 +64,6 @@ Rails.application.configure do
Bullet.enable = true
Bullet.rails_logger = true
Bullet.skip_user_in_notification = true
+ Bullet.unused_eager_loading_enable = false
end
end
Actions