Skip to content

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. 🙈 I was also thinking of loading individual diff_file existing functionality of Collapsed viewer, but that would mean it would create too much overhead so ended up with this instead.

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:

Screen_Shot_2020-08-05_at_5.04.32_pm

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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)

Edited by Sincheol (David) Kim

Merge request reports