Off-Main-Thread Baseline Compilation
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox64 | --- | fix-optional |
People
(Reporter: sstangl, Unassigned)
References
(Depends on 3 open bugs, Blocks 2 open bugs)
Details
(Whiteboard: [js-perf-next])
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Comment 2•3 years ago
|
||
That is an interesting question. I'm going to block this on Bug 1812157 where we will better study how the latency of moving the compile off-thread affects things.
Comment 3•3 years ago
|
||
One interesting point in design space, designed to let us amortize our mprotects over more compiles without getting stuck waiting: when we decide to do a baseline compile, we put it in a queue for an offthread task. The offthread task grabs it and generates native code in a buffer. When it's done, it checks to see whether there's another baseline compile queued up. If there isn't, we go ahead and link the existing code. If there is, and the amount of code in the buffer hasn't exceeded a threshold, then the background task keeps compiling code until we run out of space or queued up tasks.
Comment 4•3 years ago
|
||
I think the most interesting problem to solve for off-thread Baseline + batching is how to do the off-thread mprotect
s in a way that doesn't waste a lot of memory (because the main thread can be executing JIT code, you can't reuse pages as easily). A good solution for that could potentially also be used for IC code, if it matters.
Since this bug was filed, we've reduced the number of Baseline compilations and made them faster, so it would be good to remeasure this.
Comment 5•2 years ago
|
||
I am working on this. The mprotect problem has been circumvented by removing mprotect in content processes.
I have a preliminary version of baseline batching, but post-mprotect-removal it doesn't meaningfully improve performance. I am optimistic that moving the compilation of a batch off-thread will be an improvement. Building it on top of batched baseline compilations helps us keep the thread dispatch overhead down.
Once I get to the point where it matters I am going to try doing as much of the linking process offthread as I can. If that works out, we can consider moving more Ion linking offthread as well.
Updated•1 year ago
|
Updated•9 months ago
|
Updated•6 months ago
|
Updated•5 months ago
|
Description
•