Performance bottleneck with image diff notes

When you load an MR diff with images that have diff notes, we do a number of DOM reads and writes for each thread and discussion.

In the profiler, you can see that these trigger layouts that lock up the browser for as long they're running.

Screen_Shot_2017-10-02_at_6.49.04_PM

You can see that the bulk of the layouts are triggered during the centerButtonToCoordinates and resizeCoordinatesToImage methods:

Screen_Shot_2017-10-02_at_6.49.33_PM

This creates jank on page load, and will also create jank when image diff comments are injected into the DOM from polling.

Edited Jun 19, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading