Closed Bug 1329158 Opened 5 years ago Closed 5 years ago

Optimize maintaining scroll position in RequestListContent

Categories

(DevTools :: Netmonitor, defect, P1)

defect

Tracking

(firefox53 fixed)

RESOLVED FIXED
Firefox 53
Iteration:
53.4 - Jan 9
Tracking Status
firefox53 --- fixed

People

(Reporter: jsnajdr, Assigned: jsnajdr)

References

(Blocks 1 open bug)

Details

(Whiteboard: [netmonitor])

Attachments

(1 file)

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.
Assignee: nobody → jsnajdr
Whiteboard: [netmonitor-triage]
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 jsnajdr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6556dab689a6
Optimize maintaining scroll position in RequestListContent r=Honza
Status: NEW → ASSIGNED
Iteration: --- → 53.4 - Jan 9
Flags: qe-verify?
Priority: -- → P1
Whiteboard: [netmonitor-triage] → [netmonitor]
No longer blocks: 1328553
Blocks: 1321749
https://hg.mozilla.org/mozilla-central/rev/6556dab689a6
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Flags: qe-verify? → qe-verify-
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.