Implement a new delazification strategy to minimize main-thread effort in case of races.
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
As of today, we have only a single delazification strategy which will take functions in the order in which they appear in the source file. However, one might agree that the file order is not representative of the execution of the JavaScript sources.
Instead of focusing on guessing the ordering in which functions are taken, we could take another approach which goal is to minimize the time spent by the main thread at doing any delazification in case of races. Thus, on delazification task, we should prioritized the functions which would be costly to delazify on the main thread.
One simple approximation/heuristic of the complexity of functions is to consider the length of functions, from sourceStart
to sourceEnd
. Thus, in case of races, the main thread would most likely hit small functions.
Assignee | ||
Comment 1•2 years ago
|
||
This patch adds a new off-thread delazification strategy, which adds a bit of
overhead to queue function with a priority order, which put the largest function
as the first functions to be delazified.
The intent of this new strategy is to limit the usage of main-thread
delazification to the smallest function, in case where the main-thread would win
the delazification race.
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7ebeb45fe196 Add largest-first delazification strategy. r=arai
Comment 3•2 years ago
|
||
bugherder |
Description
•