Open Bug 1850824 Opened 1 year ago Updated 1 year ago

Scroll range snapping in nsHTMLScrollFrame::GetScrolledRect is slowing down Speedometer 3

Categories

(Core :: Web Painting, task)

task

Tracking

()

People

(Reporter: mstange, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Whiteboard: [sp3])

0.4% of our entire Speedometer 3 time is spent in nsHTMLScrollFrame::GetScrolledRect: https://share.firefox.dev/3qRY7Me

This function is called both during display list building and during layout.

If we can stop snapping the scroll range, for example by not having display item coordinates move during scrolling (and thus causing WR to always snap the same way regardless of scroll position), then our sp3 score will benefit.

Blocks: 1846559

Most of the time is the transfrom getter. Can we snap the scrollrange assuming the transform scale is 1 always? We could still include the pinch zoom resolution. But is it a big deal if we don't include the transform scale?

Maybe Hiro can speak to comment 1. Is it just things like bug 1801098 that would happen for scrollframes that have a scale transform? Are there any other negative side effects?

Flags: needinfo?(hikezoe.birchill)

(In reply to Timothy Nikkel (:tnikkel) from comment #1)

Most of the time is the transfrom getter. Can we snap the scrollrange assuming the transform scale is 1 always? We could still include the pinch zoom resolution. But is it a big deal if we don't include the transform scale?

That's a great point. Yes, I think we can assume the transform scale is 1 always. When I originally wrote the snapping I wanted to never repaint for layer pixel alignment changes even if you scroll to the bottom of a scroll frame that's inside a scale transform, but that is such a rare case that we really shouldn't take a performance hit on everything to support it.

There's nothing I can do in addition to the Makus' comment. In my naive web experiences indeed scroll containers inside scale transform is probably rare.

Flags: needinfo?(hikezoe.birchill)

Okay, I'll write up a patch for that and file a bug to get it landed.

Depends on: 1851796
You need to log in before you can comment on or make changes to this bug.