• Stan Hu's avatar
    Optimize page loading of Admin::RunnersController#show · f89dc4b0
    Stan Hu authored
    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.
    
    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 https://gitlab.com/gitlab-org/gitlab/issues/119093
    f89dc4b0
show.html.haml 3.47 KB