Bug 233684 - [Performance test] Add test lots-of-self-painting-layers.html
Summary: [Performance test] Add test lots-of-self-painting-layers.html
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: cathiechen
URL:
Keywords: InRadar
Depends on:
Blocks: 229802
  Show dependency treegraph
 
Reported: 2021-11-30 23:04 PST by cathiechen
Modified: 2021-12-13 10:15 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.65 KB, patch)
2021-11-30 23:09 PST, cathiechen
no flags Details | Formatted Diff | Diff
Patch (3.62 KB, patch)
2021-12-13 08:47 PST, cathiechen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cathiechen 2021-11-30 23:04:34 PST
Add a test to track the repaint performance of self-painting layers.
Comment 1 cathiechen 2021-11-30 23:09:50 PST
Created attachment 445527 [details]
Patch
Comment 2 cathiechen 2021-11-30 23:30:54 PST
The performance regression caused by self-painting layer.

Self-paint layers(position: relative):
:Time -> [515.0000000000018, 452, 452, 450, 453, 660, 657, 655.0000000000018, 656.0000000000018, 652, 673.9999999999982, 657.0000000000018, 661, 656, 661, 659, 660.9999999999964, 663.9999999999964, 659, 675] ms
    mean: 611.4499999999998 ms
    median: 657.0000000000009 ms
    stdev: 88.24038638556408 ms
    min: 450 ms
    max: 675 ms

Normal flow layers(position: static):
:Time -> [471, 342, 343, 335, 335, 402, 396, 383, 390, 385, 390, 387, 382, 381, 384, 379, 381.0000000000018, 385.0000000000018, 381, 381] ms
    mean: 380.6500000000002 ms
    median: 382.5 ms
    stdev: 29.207560304608954 ms
    min: 335 ms
    max: 471 ms
Comment 3 Radar WebKit Bug Importer 2021-12-07 23:05:22 PST
<rdar://problem/86193972>
Comment 4 Nikolas Zimmermann 2021-12-10 01:14:35 PST
I wouldn't call it a performance regression, after all it's a different mode. Creating N layers each rendering M elements vs. rendering one layer that renders N*M elements is naturally different: there's non-negligible amount of overhead associated with the management of layers, such as updateLayerPosition(s), etc.

Or do you call it a regression, since it was better at some point?
Comment 5 cathiechen 2021-12-13 01:57:24 PST
(In reply to Nikolas Zimmermann from comment #4)
> I wouldn't call it a performance regression, after all it's a different
> mode. Creating N layers each rendering M elements vs. rendering one layer
> that renders N*M elements is naturally different: there's non-negligible
> amount of overhead associated with the management of layers, such as
> updateLayerPosition(s), etc.
> 

Yeah, I agree with you, they are different modes.

I called this as a regression, because we were addressing a performance regression for CSS contain. Like position: relative, CSS contain creates self-painting layers, the overhead of self-painting layers caused the regression.
Because the regression is not specific to CSS contain, and CSS contain is not enabled at that time. So we created this test, and keep calling it as a regression.

I guess we can call this test as a tracking for the overhead cost of self-painting layers. What do you think?


> Or do you call it a regression, since it was better at some point?

Nope.
Comment 6 Nikolas Zimmermann 2021-12-13 04:14:20 PST
(In reply to cathiechen from comment #5)
> (In reply to Nikolas Zimmermann from comment #4)
> > I wouldn't call it a performance regression, after all it's a different
> > mode. Creating N layers each rendering M elements vs. rendering one layer
> > that renders N*M elements is naturally different: there's non-negligible
> > amount of overhead associated with the management of layers, such as
> > updateLayerPosition(s), etc.
> > 
> 
> Yeah, I agree with you, they are different modes.
> 
> I called this as a regression, because we were addressing a performance
> regression for CSS contain. Like position: relative, CSS contain creates
> self-painting layers, the overhead of self-painting layers caused the
> regression.
> Because the regression is not specific to CSS contain, and CSS contain is
> not enabled at that time. So we created this test, and keep calling it as a
> regression.
> 
> I guess we can call this test as a tracking for the overhead cost of
> self-painting layers. What do you think?
Agreed, I just found the wording regression confusing and thought you were really fixing a regression from a certain revision, that's not the case, so everything is fine.

Thanks, for looking at layer performance, very important for LBSE to migitate the self-painting layer overheads as much as possible.
Comment 7 cathiechen 2021-12-13 08:47:28 PST
Created attachment 447008 [details]
Patch
Comment 8 cathiechen 2021-12-13 09:00:06 PST
(In reply to Nikolas Zimmermann from comment #6)
> (In reply to cathiechen from comment #5)
> > (In reply to Nikolas Zimmermann from comment #4)
> > > I wouldn't call it a performance regression, after all it's a different
> > > mode. Creating N layers each rendering M elements vs. rendering one layer
> > > that renders N*M elements is naturally different: there's non-negligible
> > > amount of overhead associated with the management of layers, such as
> > > updateLayerPosition(s), etc.
> > > 
> > 
> > Yeah, I agree with you, they are different modes.
> > 
> > I called this as a regression, because we were addressing a performance
> > regression for CSS contain. Like position: relative, CSS contain creates
> > self-painting layers, the overhead of self-painting layers caused the
> > regression.
> > Because the regression is not specific to CSS contain, and CSS contain is
> > not enabled at that time. So we created this test, and keep calling it as a
> > regression.
> > 
> > I guess we can call this test as a tracking for the overhead cost of
> > self-painting layers. What do you think?
> Agreed, I just found the wording regression confusing and thought you were
> really fixing a regression from a certain revision, that's not the case, so
> everything is fine.
> 
> Thanks, for looking at layer performance, very important for LBSE to
> migitate the self-painting layer overheads as much as possible.

Great! Thanks for pointing this out:)
Comment 9 EWS 2021-12-13 10:15:02 PST
Committed r286954 (245179@main): <https://commits.webkit.org/245179@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447008 [details].