Refactor blame view
What does this MR do?
Improves performance of Projects::BlameController#show
. This MR inlines two partials, one of which was used in a potentially large loop, which will bypass the slow Rails partial rendering.
Related #220950
Performance
Some rough benchmarks from loading Gemfile.lock
on a local copy of the gitlab-org/gitlab
repo:
Before
Completed 200 OK in 1847ms (Views: 377.7ms | ActiveRecord: 9.5ms | Elasticsearch: 0.0ms | Allocations: 1274138)
Completed 200 OK in 1807ms (Views: 355.0ms | ActiveRecord: 7.9ms | Elasticsearch: 0.0ms | Allocations: 1277613)
Completed 200 OK in 1782ms (Views: 353.0ms | ActiveRecord: 7.8ms | Elasticsearch: 0.0ms | Allocations: 1214405)
After
Completed 200 OK in 1671ms (Views: 211.8ms | ActiveRecord: 7.7ms | Elasticsearch: 0.0ms | Allocations: 1099841)
Completed 200 OK in 1652ms (Views: 184.4ms | ActiveRecord: 8.1ms | Elasticsearch: 0.0ms | Allocations: 1106030)
Completed 200 OK in 1653ms (Views: 214.7ms | ActiveRecord: 7.6ms | Elasticsearch: 0.0ms | Allocations: 1100670)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Robert May