Switching between inline and side-by-side view in MRs is still very slow and heavy causing browser to freeze
Summary
Since the MR refactor happened, we've been improving performance on most common paths for users on that page.
Switching between inline and parallel has improved but still not enough.
I believe the switch is still not using the render queue we use while we first render the page.
Steps to reproduce
Open a large-enough MR (+5000 lines) and switch between inline and parallel.
What is the current bug behavior?
Browser freezes for large MRs.
Diffs rendered all at once.
What is the expected correct behavior?
Browser should not freeze for large MRs.
Diffs rendered incrementally, as on first load.
Relevant logs and/or screenshots
Kapture_2018-10-10_at_12.48.55
Possible fixes
Use the render queue that uses requestAnimationFrame and requestIdleCallback to alleviate the blockage.