Frame scheduling with CoreAnimation and WebGL
Categories
(Core :: Widget: Cocoa, defect, P2)
Tracking
()
People
(Reporter: mikokm, Unassigned)
References
Details
It seems that enabling CoreAnimation greatly affects frame scheduling of glterrain test, especially when run under ASAP mode. I find it particularly worrying how every second paint seems to get timing of 0.0.
profiles:
CoreAnimation enabled, ASAP mode: https://perfht.ml/2CzXVVi
CoreAnimation disabled, ASAP mode: https://perfht.ml/34RvNJj
glterrain talos test on 2018 MBP:
CoreAnimation enabled:
0.WebGL-terrain-alpha-no-AA-no= Average: 26.66 stddev: 9.4 (35.2%)
Intervals: 16.0 34.0 33.0 33.0 17.0 33.0 34.0 34.0 15.0 51.0 16.0 17.0 33.0 17.0 33.0 34.0 33.0 33.0 18.0 33.0
1.WebGL-terrain-alpha-no-AA-yes= Average: 26.34 stddev: 8.9 (33.8%)
Intervals: 16.0 34.0 16.0 17.0 33.0 34.0 16.0 17.0 33.0 17.0 34.0 33.0 17.0 33.0 17.0 33.0 17.0 33.0 17.0 33.0
2.WebGL-terrain-alpha-yes-AA-no= Average: 28.50 stddev: 9.5 (33.3%)
Intervals: 16.0 34.0 17.0 33.0 18.0 32.0 18.0 32.0 17.0 34.0 17.0 32.0 17.0 18.0 31.0 17.0 34.0 17.0 34.0 32.0
3.WebGL-terrain-alpha-yes-AA-yes= Average: 28.67 stddev: 8.5 (29.8%)
Intervals: 33.0 17.0 33.0 18.0 32.0 18.0 33.0 17.0 32.0 17.0 33.0 17.0 33.0 34.0 16.0 34.0 16.0 33.0 17.0 34.0
CoreAnimation disabled:
0.WebGL-terrain-alpha-no-AA-no= Average: 20.33 stddev: 7.1 (34.8%)
Intervals: 17.0 16.0 17.0 16.0 18.0 16.0 17.0 15.0 34.0 17.0 16.0 18.0 17.0 16.0 16.0 17.0 17.0 33.0 17.0 16.0
1.WebGL-terrain-alpha-no-AA-yes= Average: 20.00 stddev: 6.6 (33.2%)
Intervals: 32.0 18.0 16.0 34.0 17.0 32.0 18.0 32.0 17.0 16.0 33.0 18.0 33.0 17.0 16.0 34.0 17.0 33.0 17.0 16.0
2.WebGL-terrain-alpha-yes-AA-no= Average: 20.84 stddev: 7.5 (35.9%)
Intervals: 34.0 16.0 33.0 18.0 16.0 16.0 34.0 16.0 33.0 18.0 34.0 16.0 17.0 17.0 33.0 17.0 33.0 16.0 34.0 17.0
3.WebGL-terrain-alpha-yes-AA-yes= Average: 21.50 stddev: 7.9 (36.5%)
Intervals: 17.0 17.0 17.0 16.0 16.0 34.0 16.0 18.0 15.0 17.0 17.0 34.0 16.0 17.0 17.0 16.0 17.0 16.0 34.0 16.0
CoreAnimation enabled, ASAP mode:
0.WebGL-terrain-alpha-no-AA-no= Average: 17.70 stddev: 16.8 (95.0%)
Intervals: 0.0 25.0 0.0 26.0 0.0 25.0 0.0 28.0 0.0 [_57.0_] 0.0 3.0 17.0 26.0 26.0 24.0 26.0 24.0 24.0 25.0
1.WebGL-terrain-alpha-no-AA-yes= Average: 18.32 stddev: 14.6 (79.8%)
Intervals: 1.0 27.0 1.0 27.0 1.0 22.0 1.0 27.0 0.0 27.0 0.0 27.0 0.0 28.0 0.0 24.0 1.0 30.0 0.0 24.0 0.0 27.0
2.WebGL-terrain-alpha-yes-AA-no= Average: 24.58 stddev: 13.4 (54.5%)
Intervals: 0.0 27.0 0.0 26.0 0.0 27.0 0.0 25.0 2.0 25.0 0.0 26.0 27.0 27.0 26.0 23.0 25.0 28.0 28.0 32.0 27.0
3.WebGL-terrain-alpha-yes-AA-yes= Average: 14.83 stddev: 14.8 (100.1%)
Intervals: 0.0 28.0 0.0 27.0 1.0 [_33.0_] 0.0 [_31.0_] 1.0 [_33.0_] 0.0 [_35.0_] 0.0 [_31.0_] 0.0 [_34.0_]
CoreAnimation disabled, ASAP mode:
0.WebGL-terrain-alpha-no-AA-no= Average: 18.28 stddev: 1.1 (6.1%)
Intervals: 20.0 19.0 19.0 18.0 19.0 17.0 18.0 18.0 18.0 18.0 19.0 18.0 18.0 18.0 18.0 17.0 20.0 19.0 18.0 18.0
1.WebGL-terrain-alpha-no-AA-yes= Average: 18.70 stddev: 2.2 (11.8%)
Intervals: 17.0 18.0 21.0 19.0 17.0 18.0 21.0 22.0 17.0 21.0 18.0 17.0 18.0 22.0 16.0 18.0 22.0 17.0 17.0 22.0
2.WebGL-terrain-alpha-yes-AA-no= Average: 18.43 stddev: 1.8 (10.0%)
Intervals: 19.0 17.0 17.0 22.0 17.0 17.0 22.0 18.0 17.0 17.0 17.0 18.0 22.0 18.0 18.0 16.0 22.0 16.0 17.0 22.0
3.WebGL-terrain-alpha-yes-AA-yes= Average: 18.91 stddev: 2.3 (12.4%)
Intervals: 18.0 18.0 18.0 22.0 18.0 16.0 23.0 16.0 22.0 16.0 18.0 22.0 17.0 21.0 16.0 23.0 17.0 18.0 22.0 17.0
In Chrome, the average for all tests is 16.67.
Reporter | ||
Comment 1•5 years ago
|
||
Markus, do you any idea what could be going on here?
Comment 2•5 years ago
|
||
(In reply to Miko Mynttinen [:miko] from comment #0)
I find it particularly worrying how every second paint seems to get timing of 0.0.
I agree, that part is very unexpected!
In general, CoreAnimation affects composite times because it no longer gives us a way to wait for the window server to composite our rendering. We can wait for our own rendering, but once we submit the CoreAnimation transaction, the window server is free to pick it up at any time and will do so at its own convenience.
In the past, ASAP mode would also force the window server to composite "ASAP" because that's what happens when you call flushBuffer on a surface-backed OpenGL context with swap interval "0". But CA does not have such a thing.
Safari developers said that they also cannot tell whether the window server composited their current layer tree, and so sometimes their numbers on graphics tests may be artificially high because they only measure Safari's performance and not the window server's performance.
I'll look into why every second composite is instant. The client wait syncs should not allow that to happen, in theory.
Comment 3•5 years ago
|
||
I looked at the profiles again, and it looks like this is actually a pre-existing issue. In both profiles, there are parts where every second composite is instant, and parts where this effect does not occur. Moreover, both profiles have parts where the content process main thread is permanently busy ticking the refresh driver and bailing out because they're waiting for the composite, and parts where the content process only has a mild load because the refresh driver ticks at a lower rate. I don't know why those two modes exist.
Here's an excerpt from the CoreAnimation off profile with long/short/long/short composites: http://bit.ly/35pDre4
I wonder why those short composites are not reflected in the "Intervals" that Talos collects. Also, the profile shows a lot more composites than the "Intervals" list.
Comment 4•5 years ago
|
||
The priority flag is not set for this bug.
:spohl, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 5•4 years ago
|
||
I didn't end up looking into why every second composite is instant. This would still be interesting to know.
Description
•