Render identical diff file header buttons once per request

What does this MR do and why?

The diff file header renders two toggle buttons and an options menu button that are identical for every file, but they were rendered once per file. This MR renders them once per request and reuses them across files. Server-side only, no UI change.

Measurements

Server render of the 1,000-file stream in a warm Rails runner: 1.18 s to 1.12 s (about 5%).

Browser, same local 1,000-file merge request (998 streamed files, about 85k elements), Overview tab then Changes tab, headless 1440x900, no extensions, master and the branch served by the same local stack, 3 runs each, medians:

Browser Blocked before Blocked after Longest task before Longest task after Last file before Last file after
Chromium 151 748 ms 783 ms (within noise) 319 ms within noise 5.0 s 5.0 s (within noise)
Firefox 152 2,518 ms 2,494 ms (within noise) 1,024 ms within noise 5.7 s 5.6 s (within noise)

This is a small server-side saving with no measurable client-side effect.

Reproduction steps

  1. Open any MR's Changes tab in Rapid Diffs.
  2. Confirm the header buttons (collapse/expand, options menu) render and work on every file.
  3. Switch the interface language and confirm the button labels follow the locale.

References

Split out of !253645 (original umbrella MR, now the complete-file streaming MR).

Sibling MRs from the same investigation:

  • !253645 - Insert complete diff files while streaming Rapid Diffs
  • !253736 (merged) - Stop re-rendering the file browser per streamed diff file
  • !253737 (closed) - Cut redundant per-file scans while streaming Rapid Diffs
  • !253738 (closed) - Skip the web streams polyfill when the browser can pipe natively
  • !253739 (closed) - Keep streamed HTML tasks short in the chunk writer

Feedback thread: #596236

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stanislav Lashmanov

Merge request reports

Loading
Loading