Add an about:config preference to toggle the various eager delazification strategies.
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Eager delazification generates the bytecode of function off-thread while either waiting for other resources or executing the JavaScript code which is already delazified.
We have different strategies to order or skip functions for which we would be generating bytecode. We need to evaluate which order and filtering methods are the best for the web by being able to toggle between different strategies.
To toggle between different strategies, we need a flag which can easily be changed for A/B testing.
Assignee | ||
Comment 1•3 years ago
|
||
This patch changes the way we parse JavaScript coming from Necko while loading
web pages, by adding an about:config flag named
javascript.options.delazification.strategy which is used to select between:
0 - On Demand
1 - Concurrent Depth First
255 - Parse Everything Eagerly
Previously, we moved from On-demand delazification, to parsing everything
eagerly to improve responsiveness of the browser, but we knew that more room for
optimization exists.
This toogle is meant to explore the space of delazification strategies, such
that we can parse functions of JavaScript files on an helper thread, while the
JavaScript file is being executed on the main thread. The space of
delazification strategies goes from ordering the order in which functions are
processed, as well as filtering functions which are processed. Not all functions
have to be delazified, and if the main thread needs a function which is not
parsed yet, it will fallback to parsing it on-demand.
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13dbf5b806ec Remove unused DelazificationOption. r=arai https://hg.mozilla.org/integration/autoland/rev/9d41db9f2e17 JavaScript: Add a preference to switch between delazification strategies. r=arai https://hg.mozilla.org/integration/autoland/rev/8d2f548f2b46 Add test case to verify delazification strategy is used. r=arai
Comment 5•3 years ago
|
||
Backed out 3 changesets (Bug 1753709) for causing build bustages on ScriptLoader.cpp.
Backout link
Push with failures
Failure Log
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/891174ee20ee Remove unused DelazificationOption. r=arai https://hg.mozilla.org/integration/autoland/rev/193409767cf2 JavaScript: Add a preference to switch between delazification strategies. r=arai https://hg.mozilla.org/integration/autoland/rev/eb7704e8a30c Add test case to verify delazification strategy is used. r=arai
Assignee | ||
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Backed out 3 changesets (Bug 1753709) for causing build bustages on ScriptLoader.cpp.
Backout link
Push with failures
Failure Log
Assignee | ||
Updated•3 years ago
|
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/224f4cf66993 Remove unused DelazificationOption. r=arai https://hg.mozilla.org/integration/autoland/rev/56a169a692b9 JavaScript: Add a preference to switch between delazification strategies. r=arai https://hg.mozilla.org/integration/autoland/rev/b908fc38d2d3 Add test case to verify delazification strategy is used. r=arai
Comment 9•3 years ago
|
||
Backed out for causing mochitest failures on test_delazification_strategy.html
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | dom/base/test/test_delazification_strategy.html | Test timed out. - Test timed out.
Comment 10•2 years ago
|
||
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ba642f524eb Remove unused DelazificationOption. r=arai https://hg.mozilla.org/integration/autoland/rev/c4b3ea8cc850 JavaScript: Add a preference to switch between delazification strategies. r=arai https://hg.mozilla.org/integration/autoland/rev/92c286a2adf9 Add test case to verify delazification strategy is used. r=arai
Assignee | ||
Comment 11•2 years ago
|
||
(In reply to Cristian Tuns from comment #9)
Backed out for causing mochitest failures on test_delazification_strategy.html
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | dom/base/test/test_delazification_strategy.html | Test timed out. - Test timed out.
The problem was caused by a failure to capture the event sent to the script tag while loading the script.
Strangely, I do not know why this would fail on this test case and not on test_script_loader_js_cache.html
, from which this test case was derived.
Mean while the solution taken, thanks to Arai, was to load the page without any script tag and dynamically add a script tag once the iframe is loaded, and event listeners are attached to the iframe window.
Comment 12•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1ba642f524eb
https://hg.mozilla.org/mozilla-central/rev/c4b3ea8cc850
https://hg.mozilla.org/mozilla-central/rev/92c286a2adf9
Description
•