Closed Bug 1375764 Opened 7 years ago Closed 7 years ago

stylo: significant time spent in update_animations on wikipedia

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bholley, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

(1) DISABLE_STYLE_SHARING_CACHE=1 STYLO_THREADS=1 ./mach run
(2) start the gecko profiler with 0.2ms resolution
(3) load [1]
(4) paste [2] into the scratchpad and capture a profile.

Profile: http://bit.ly/2tA5k1d

This shows us spending 2ms (~2% of the traversal) in update_animations, which is a lot for a page that doesn't seem to have much in the way of animations going on. I do see centralAuthPPersonalAnimation, but that doesn't sound like something that ought to be very expensive.

Note that this doesn't happen during the initial styling of the document, and is also much more noticeable on this testcase with the style sharing cache disabled.

[1] https://www.dropbox.com/s/zayqjg37wh28v8q/obama-noscript.tar.bz2?dl=0

[2]
var s = document.createElement('style');
s.innerHTML = '*|* { color: red }';
document.head.appendChild(s);
s.remove();
window.getComputedStyle(document.body).color;
Hiro, any general sense of what's going on here?
Flags: needinfo?(hikezoe)
Depends on: 1375767
At first glance of the profile, nsCSSPseudoElements::GetPseudoType took 0.6ms, it should be replaced by a function just returns ::before, ::after or none (i.e not pseudo).

File bug 1375767 for it.
Flags: needinfo?(hikezoe)
Depends on: 1375787
There is another issue that we call update_animations for the case of FOR_CSS_RULE_CHANGES traversal even if there is no CSS animation.

Filed bug 1375787 for it.
Thanks for jumping on this Hiro!
Now bug 1375767 and bug 1375787 landed. I don't see update_animations in a profile I got locally.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.