Skip to content

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)

Screen_Shot_2018-09-17_at_12.45.41

Screen_Shot_2018-09-17_at_12.45.31

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:

Screen_Shot_2018-09-18_at_21.54.53

We're able to see the following Gitaly profile for the RPC:

Screen_Shot_2018-09-18_at_21.54.44

Which shows the diff --numstat processing is quite fast. This should be tested on staging, though.

Does this MR meet the acceptance criteria?

Edited by Nick Thomas

Merge request reports