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.
You can see that the bulk of the layouts are triggered during the centerButtonToCoordinates
and resizeCoordinatesToImage
methods:
This creates jank on page load, and will also create jank when image diff comments are injected into the DOM from polling.