Use standalone diff stats RPC on every comparison view
What does this MR do?
Whenever possible, we're now using the Gitaly Diff Stats RPC instead parsing raw diffs to calculate additions and deletions.
That's a great change, because now we don't have to:
- Load raw diffs into memory then parse it
- Create complex code to expand diffs, then calculate large diff file stats
Images showing a collapsed diff presenting correct diff stats (no expanding needed)
Where it's currently being used
- Merge request
/diffs
tab - Merge request commit diffs
- Repository comparison view
- Merge requests creation page
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/49399 https://gitlab.com/gitlab-org/gitlab-ce/issues/20282 https://gitlab.com/gitlab-org/gitlab-ce/issues/51477
Performance statistics
In a MR with the following statistics:
We're able to see the following Gitaly profile for the RPC:
Which shows the diff --numstat
processing is quite fast. This should be tested on staging, though.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Nick Thomas