Open Bug 1571800 Opened 6 years ago Updated 10 months ago

Tons of time spent on the main thread when animations are accelerated in nsIFrame::IsScrolledOutOfView.

Categories

(Core :: CSS Transitions and Animations, defect, P3)

defect

Tracking

()

Performance Impact low

People

(Reporter: emilio, Unassigned)

Details

(Keywords: perf, perf:responsiveness)

Attachments

(1 file)

Attached file t.html

See the attached test-case, which are just a lot of visible animations on the screen.

The main thread is perma-busy checking IsScrolledOutOfView() and similar stuff... Maybe we should check it less often? It's probably fine if we spend a few extra milliseconds frames running an off-screen animations.

Profile: https://perfht.ml/33eXvjd

(Ignore the style time which is me moving the mouse towards the profiler popup)

Keywords: perf
Whiteboard: [qf]

I assume "less often" means using a longer period time to unthrottle transform animations on the compositor. Probably we can use a longer value than 200ms.

Another way I can think of is somewhat similar to what we currently do for scale animation.

When we build display lists, we compute maximum/minimum possible scale value by animations, we use the value to avoid blurry rendering results on the compositor. We can compute maximum possible nsRect by transform animations as well and if the rect is completely inside the scrollable frame, we don't need to unthrottle the transform animations at all. (Probably we shouldn't do this optimization for 3d transforms?). If a transform animation has thousands of keyframes and one of the keyframes makes the transform overflow from the scrollable frame, this optimization gets horribly slow, so we should probably cache the maximum rect information.

Whiteboard: [qf] → [qf:p3:responsiveness]

The priority flag is not set for this bug.
:boris, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(boris.chiou)
Flags: needinfo?(boris.chiou)
Priority: -- → P3
Performance Impact: --- → P3
Whiteboard: [qf:p3:responsiveness]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: