Until the thread list was added, we rarely rendered a large number of diff comments at once. A diff would add them incrementally in an asynchronous loop, and even then, their number was reduced by being filtered to to the given path and patch range. Rendering all comments at once in the thread list exposed inefficiencies in instantiating gr-diff-comments, and, for changes with many comments, could temporarily lockup the browser. The biggest cause of slowness in comment instantiation was the textarea for editing. Because existing comments are not in an edit state by default (...and because only the final comment in a thread can be edited anyway ... assuming the user even chooses to edit ... assuming there even is an authenticated user...) it's more efficient to put the textarea in a dom-if until it's needed. The overlays are also expensive but infrequently used. These are put inside a dom-if as well. Change-Id: I50702afe2b178221110ad3200c5e3862a7722c5d
29 KiB
29 KiB