Skip to content

Introduce diffs_batch JSON endpoint for paginated diffs

Oswaldo Ferreira requested to merge 31290-mr-diffs-batch-load into master

What does this MR do?

Introduces the new diffs_batch.json endpoint without changing the existing diffs.json. This endpoint accepts the following arguments:

  • page (default 1 if not given)
  • per_page (default 20 if not given)

Benchmarks (before / after - 3rd and beyond are paginated):

Screen_Shot_2019-10-01_at_18.39.42

  • Gitaly calls are currently under 3
  • Queries under 13
  • Both below 50ms
  • Most time is currently spent serializing the diff files

Remarks:

  • We're not using the highlighted diff cache given how inefficient it is to write/read all cache at once. We'll be able to improve this further with #30550 (closed).
  • We need to calculate how much we've loaded for diffs in previous files. That's necessary in order to know whether we're hitting the collection limits or not (commented at the code).

TODO

  • Refactor
  • Double check timings on Redis, DB and Gitaly (can we improve it further?)
  • Add tests
  • Add benchmarks
  • Add profile data

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

#31290 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports