Actions
Patch #42555
closedAdds the Bullet gem to detect query problems such as N+1 and improve performance
Description
This patch adds and enables the Bullet gem in the development environment. Bullet helps Redmine developers detect query problems such as N+1, making it easier to improve application performance during development.
For example, the following Rails log is shown when viewing an issue in development:
... ↳ lib/redmine/preparation.rb:383:in `block (2 levels) in prepare' Rendered layout layouts/base.html.erb (Duration: 1414.4ms | GC: 251.1ms) Completed 200 OK in 2320ms (Views: 1377.8ms | ActiveRecord: 81.2ms (102 queries, 16 cached) | GC: 307.1ms) user: developer GET /issues/1 USE eager loading detected Journal => [:updated_by] Add to your query: .includes([:updated_by]) Call stack /redmine/app/models/issue.rb:919:in `visible_journals_with_index' /redmine/app/controllers/issues_controller.rb:97:in `show' /redmine/lib/redmine/sudo_mode.rb:78:in `sudo_mode' user: developer GET /issues/1 AVOID eager loading detected User => [:email_address] Remove from your query: .includes([:email_address]) Call stack /redmine/app/models/issue.rb:919:in `visible_journals_with_index' /redmine/app/controllers/issues_controller.rb:97:in `show' /redmine/lib/redmine/sudo_mode.rb:78:in `sudo_mode'
Files
Actions