Closed Bug 1329158 Opened 5 years ago Closed 5 years ago
Optimize maintaining scroll position in Request
59 bytes, text/x-review-board-request
Profiling the React/Redux implemenation of Netmonitor UI with Cleopatra tells me that a lot of time is spent in RequestListContent.componentDidUpdate setting the node.scrollTop property. This scrolls the list to the bottom, and it's an expensive operation that triggers reflow. My testing shows that it's performed twice as often than necessary. In approx half of the cases, the request list length didn't change, so updating the scroll position is not needed.
The patch does two things: - when determining "shouldScrollToBottom", check if the request list size is increasing for this update - drive-by improvement of "setScalingStyles": the "currentScale" value doesn't need to be stored - can be computed from prevProps
Comment on attachment 8824376 [details] Bug 1329158 - Optimize maintaining scroll position in RequestListContent https://reviewboard.mozilla.org/r/102902/#review103372 LGTM, thanks Jarda! Honza
Attachment #8824376 - Flags: review?(odvarko) → review+
Try is green, going to land: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1ebbfe40a3d64f832b340395c549fdbe69a4cf1 I'll be investigating what performance improvements are really visible in talos.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/6556dab689a6 Optimize maintaining scroll position in RequestListContent r=Honza
Status: NEW → ASSIGNED
Iteration: --- → 53.4 - Jan 9
Priority: -- → P1
Whiteboard: [netmonitor-triage] → [netmonitor]
You need to log in before you can comment on or make changes to this bug.