Closed
Bug 1372207
Opened 8 years ago
Closed 8 years ago
JS bytecode cache should use Idle callback to trigger the encoding.
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
Details
Attachments
(1 file, 1 obsolete file)
1.38 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
At the moment, the JSBC uses the next cycle after the load-end event and the last script tag to be executed (in case the load event were to inject a new script tag).
Instead of using the next cycle after the load-end event, we should use the next idle-time after the load-end event, such that we any code which is spinning the event loop after the load end can still be captured by the bytecode cache encoding.
Assignee | ||
Comment 1•8 years ago
|
||
This replaces the NS_DispatchToCurrentThread by the document event target
for the idle callback.
This code seems to be the first code to ever use the
TaskCategory::IdleCallback, is that the proper category that I should be
using for this task?
Assignee | ||
Updated•8 years ago
|
Attachment #8876711 -
Flags: review?(wmccloskey)
Comment 2•8 years ago
|
||
TaskCategory::IdleCallback doesn't mean anything yet. (It is very confusing to have it. )
We need to change idle dispatch to use all this TaskCategory stuff.
Also, should we ensure EncodeBytecode is called eventually? If so, http://searchfox.org/mozilla-central/rev/d840ebd5858a61dbc1622487c1fab74ecf235e03/xpcom/threads/nsThreadUtils.cpp#368 is probably the right method to use.
(You may want to ask farre too)
Assignee | ||
Comment 3•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> Also, should we ensure EncodeBytecode is called eventually?
We do not have to, as the code could be clean-up by the destructor of the ScriptLoader, but the NewRunnableMethod has an Owning reference to the ScriptLoader, so in the current implementation we would have to ensure that it is called such that we can later remove the ScriptLoader instance.
> If so,
> http://searchfox.org/mozilla-central/rev/
> d840ebd5858a61dbc1622487c1fab74ecf235e03/xpcom/threads/nsThreadUtils.cpp#368
> is probably the right method to use.
Ok, I will use that instead.
Assignee | ||
Updated•8 years ago
|
Attachment #8876711 -
Flags: review?(wmccloskey)
Assignee | ||
Comment 4•8 years ago
|
||
Use NS_IdleDispatchToCurrentThread instead of NS_DispatchToCurrentThread.
Assignee | ||
Updated•8 years ago
|
Attachment #8876711 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8877123 -
Flags: review?(bugs)
Comment 5•8 years ago
|
||
Comment on attachment 8877123 [details] [diff] [review]
Schedule JSBC encoding to be executed at the next idle time after the onload event.
This makes it more likely that EncodeBytecode never runs during the lifetime of document, but I guess that is fine, since that has been possible before too, in case document lifetime is short.
Attachment #8877123 -
Flags: review?(bugs) → review+
Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fccb81aa0a57
Schedule JSBC encoding to be executed at the next idle time after the onload event. r=smaug
Assignee | ||
Updated•8 years ago
|
Component: JavaScript Engine → DOM
Comment 7•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•