consider to optimize Animation::Cancel
Categories
(Core :: CSS Transitions and Animations, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | ? |
People
(Reporter: smaug, Assigned: emilio)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sp3-anyone])
Attachments
(2 files)
When running the React part of speedometer 2.1, in its DeletingAllItems subtest animation cancelling is taking some time.
https://share.firefox.dev/3Vk15Cz
https://share.firefox.dev/3PJhAXC
It shows up as part of DOM-category.
Could we perhaps avoid some allocations and when the events are finally dispatched, check first if there are listeners?
Reporter | ||
Comment 1•3 years ago
|
||
And looks like also https://searchfox.org/mozilla-central/rev/e6b709df9b93858364f02ab89f40d78762693db8/dom/base/Element.cpp#1969-1977 plays a part here.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Comment 2•3 years ago
|
||
Another profile https://share.firefox.dev/3j1aMbO
Comment 3•3 years ago
|
||
FWIW here's a version of one of those profiles, with mozilla::dom::Animation::Cancel
focused, and with stack inverted. This shows that all of the time is spent in PR_Now
, called by Event::ConstructorInit
.
(I don't immediately see where Event::ConstructorInit
calls PR_Now
; it's probably inlined somewhere.)
In any case: agreed that it'd be nice to avoid dispatching the event in the first place if there are no listeners, if that's something that's easy to detect (not sure).
Comment 4•3 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #3)
FWIW here's a version of one of those profiles, with
mozilla::dom::Animation::Cancel
focused, and with stack inverted. This shows that all of the time is spent inPR_Now
, called byEvent::ConstructorInit
.
Here's that link: https://share.firefox.dev/3JjrOwr
(This is from smaug's very first profile in comment 0 BTW.)
Reporter | ||
Comment 5•3 years ago
|
||
There is no PR_Now() anymore (bug 1807812), I'll reprofile.
The code mentioned in comment 1 is still there.
Reporter | ||
Comment 6•3 years ago
•
|
||
https://share.firefox.dev/3RcJdJk is a new one, focused on Animation::Cancel
At least there is EffectSet::DestroyEffectSet. That relates to the same code mentioned in comment 1.
I think we should remove property usage and move the relevant stuff to be part of the
nsExtendedDOMSlots https://searchfox.org/mozilla-central/rev/3a13c5ad9c1dbd065e484a399af75eb98c235def/dom/base/FragmentOrElement.h#157
I guess there could be a helper struct which had (strong?) pointer to each of the properties and nsExtendedDOMSlots could have UniquePtr pointing to that struct.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
An earlier version of the patch triggered and it wasn't trivial to see
the message.
Assignee | ||
Comment 8•3 years ago
|
||
This should both be faster and simpler. Also will allow us in the future
to animate more pseudos without having to add a gazillion properties.
I think we should try to clear more stuff (maybe the whole animation
data) on unbind, but that's a bit tangential.
Depends on D169859
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 10•3 years ago
|
||
bugherder |
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 13•3 years ago
•
|
||
Did this improve AWFY-Inferno-TodoMVC by 31% ?
https://treeherder.mozilla.org/perfherder/graphs?highlightAlerts=1&highlightChangelogData=1&highlightCommonAlerts=0&series=mozilla-central,3735844,1,13&series=mozilla-central,3735844,1,13&series=autoland,3912889,1,13&timerange=5184000&zoom=1676217310774,1676633129097,130.93007596856472,272.84116685079124\
(it also improved some subtests by 99% !)
And some improvement in VueJS-TodoMVC by 6.3%.
Updated•3 years ago
|
Description
•