Skip to content

Fix MR diff file performance measurement

What does this MR do and why?

For #408918 (closed)

Start the diff files load performance measurement when loading files in file-by-file mode.

The performance measurements require a start & end (and have middle events, too), but the start event was only triggered by batch loading.
Now that file-by-file loading only loads one file at a time, the measurement wasn't started, so when the file loaded and marked the end of the measurement, an error was triggered.

This change starts the measurement any time a file is loaded, whether in batches or one at a time.

Concern

There are now two "tiers" of performance measurement for loading diffs:

  1. All diff files ("batch loading") which will have a meaningful difference between start and final display of the last file
  2. Single-file diffs (file-by-file) which will not have a meaningful difference between start and final display except in the most extreme cases where a massive file will take a long time to load.

In this second case, the performance measurements seem fairly useless. The information we get from loading and displaying a single file is pretty "noisy" (directly affected by network latency, CPU load, etc.) while the information we get from batch loading smooths out most of that noise.

While this is the "correct" fix (also measure the performance when a single file loads), it's going to create a ton of variance in how the page is measured based on what mode the user is in, and the right fix is likely to remove performance measurement altogether when in file-by-file mode, or create a whole new metric for that specific case.

Screenshots or screen recordings

N/A

How to set up and validate locally

  • Visit an MR with & without File-by-File mode enabled

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports