Testcase creating long chains of microtasks is 8x slower with the new microtaskQueue. Spends all the time in MinorGC tracing js::MicroTaskQueueSet::trace and TraceableFifo::trace
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox146 | --- | fixed |
People
(Reporter: mayankleoboy1, Assigned: mgaudet)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
enable the new js-managed-microtask
Open attached testcase
click run
default microtask: https://share.firefox.dev/4hLOHIo (9s)
new microtask: https://share.firefox.dev/4oMt1xS (72s)
Testcase created using chatgpt. 100% artificial.
Deliberately not making this bug bug 1990841 as this is a stress-test.
| Reporter | ||
Comment 1•8 months ago
•
|
||
Perhaps an equivalent and simpler testcase.
N=5000000
Profile: https://share.firefox.dev/4ol5PXT (110s)
Chrome: https://share.firefox.dev/48RAlUm (1.5s)
Comment 2•8 months ago
|
||
This is probably because of the PersistentRooted collections in JSContext used for the microtask queue. These are always a risk for causing quadratic behaviour. To fix this we could change the microtask queues to use TracebleFifo<HeapPtr<Value>> (to put nursery values into the store buffer) and trace the queues in JSContext::trace, but only if we're not doing a minor GC.
Updated•7 months ago
|
| Reporter | ||
Comment 3•7 months ago
|
||
this testcase is kinda silly. Feel free to wontfix.
| Assignee | ||
Comment 4•7 months ago
|
||
Updated•7 months ago
|
Comment 6•7 months ago
|
||
| bugherder | ||
| Reporter | ||
Comment 7•7 months ago
|
||
Testcase1: https://share.firefox.dev/491RV8e (9.5s + 0.5s cleanup)
Testcase2: https://share.firefox.dev/4oW0ead (13s)
Updated•7 months ago
|
| Assignee | ||
Comment 8•7 months ago
•
|
||
We're going to back the solution to this out (See Bug 2002849), and re-open this bug. We'd like to get to a better solution, but for now the performance impact of this on JS3 was too high.
Oh, right, and I'll clone this bug rather than re-open it.
| Assignee | ||
Updated•7 months ago
|
Description
•