Skip to content

Optimize page loading of Admin::RunnersController#show

Stan Hu requested to merge sh-optimize-runners-admin-show into master

This commit optimizes the page loading of this page in several ways:

  1. Remove exact counting of projects on the page. By default, a SELECT COUNT(*) FROM projects would be called, which could take seconds on an instance with many projects. Now we paginate without exact counts, which causes only the Prev and Next buttons appear instead of a numbered set.

  2. Preload project/namespace/routes where necessary. This reduces a significant number of N+1 queries.

  3. Remove the use of becomes(Namespace) because this causes a SQL query each time it is called. Instead, use the Rails path helpers to generate the path directly via project.namespace.

Closes #119093 (closed)

Edited by Stan Hu

Merge request reports