Closed
Bug 1401919
Opened 7 years ago
Closed 7 years ago
Functions used after the seekToNextFrame promise are interpreted half the time
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
Details
Attachments
(1 file)
1.42 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
See this profile: https://perfht.ml/2hm81On The code being profiled is: https://pastebin.mozilla.org/9067853 To run it without hitting bug 1401757, the "media.dormant-on-pause-timeout-ms" pref needs to be set to -1 in about:config. The onFrame function is called 115 times here. Half the time through Interpret and half the time through js::jit::EnterBaselineMethod. Each time the GC is called, the next run goes through Interpret. nbp tells me there's an optimization to keep alive the functions used with requestAnimationFrame and thinks it may be possible to do the same thing for functions following the seekToNextFrame promise.
Flags: needinfo?(bhackett1024)
Comment 1•7 years ago
|
||
Yes, the NotifyAnimationActivity() API is used to notify the JS engine of animation activity in a compartment, so that if it GCs while an animation is playing it will avoid discarding Ion/Baseline code in that compartment.
Flags: needinfo?(bhackett1024)
Assignee | ||
Comment 2•7 years ago
|
||
This is a copy of the code at http://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/dom/html/HTMLCanvasElement.cpp#1095 I verified with the profiler that this patch has the impact I expected (ie. once my function used with seekToNextFrame is baseline compiled, it doesn't go through the interpreter again after each GC).
Attachment #8913465 -
Flags: review?(jwwang)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → florian
Status: NEW → ASSIGNED
Comment 3•7 years ago
|
||
Comment on attachment 8913465 [details] [diff] [review] Patch Review of attachment 8913465 [details] [diff] [review]: ----------------------------------------------------------------- A JS peer should review this code.
Attachment #8913465 -
Flags: review?(jwwang) → review?(jorendorff)
Comment 4•7 years ago
|
||
Comment on attachment 8913465 [details] [diff] [review] Patch Review of attachment 8913465 [details] [diff] [review]: ----------------------------------------------------------------- I am no expert in DOM media element, but concerning the usage of the JSAPI, this patch sounds good to me. NotifyAnimationActivity does not GC, so there is no reason for rooting the object.
Attachment #8913465 -
Flags: review?(jorendorff) → review+
Pushed by florian@queze.net: https://hg.mozilla.org/integration/mozilla-inbound/rev/03487f70562a Functions used after the seekToNextFrame promise should not be interpreted half the time, r=nbp.
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/03487f70562a
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•