Load commit diff_files asynchronously
What does this MR do?
Following on from the conversation at #232509 (comment 386707488), I've chosen to go down the path of simple(but dirty) solution as a first step.
This is an attempt to improve the page loading performance of Commit#show page. Ideally, we would need to break it down even more with a paginated loading like MergeRequest#diffs does, but this change itself gives us some performance improvements without the pagination.
Here is the performance comparison for before and after.
Before:
* Environment: Localhost
* Environment Version: 13.3.0-pre `baf8fccc35b`
* Option: 60s_20rps
* Date: 2020-08-05
* Run Time: 2m 32.95s (Start: 07:11:33 UTC, End: 07:14:06 UTC)
* GPT Version: v2.0.5
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
-------------------|-----|------------------|------------|-----------------------|----------------|-----------------
web_project_commit | 2/s | 0.32/s (>0.32/s) | 15040.27ms | 17641.91ms (<12500ms) | 100.00% (>95%) | FAILED²
After:
* Environment: Localhost
* Environment Version: 13.3.0-pre `baf8fccc35b`
* Option: 60s_20rps
* Date: 2020-08-05
* Run Time: 1m 2.89s (Start: 07:09:28 UTC, End: 07:10:31 UTC)
* GPT Version: v2.0.5
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
-------------------|-----|------------------|----------|---------------------|----------------|----------------
web_project_commit | 2/s | 1.95/s (>0.32/s) | 547.87ms | 804.13ms (<12500ms) | 100.00% (>95%) | Passed
Screenshots
Initial loading:
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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
Related to #232509 (closed)