Main thread allocation can block waiting for background free
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox133 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I noticed while profiling the browser that freeing empty arenas on the background thread can block allocating arenas on the main thread. Despite the fact that we periodically release the GC lock to allow the main thread to run, it seems as if the main thread isn't scheduled in time and the background thread takes the lock again and keeps running.
This affects the splay benchmark and presumably other cases of high allocation bandwidth.
Assignee | ||
Comment 1•4 months ago
|
||
This patch attempts to do more work to release empty arenas outside the GC lock
to allow the main thread to take the lock during perious of high allocator
throughput.
This has a large effect in local testing, improving splay and splay latency
scores by 4% and 21% respectively on macOS and by 4% and 6% on Linux. The
difference on try was much more moderate but it still showed some nice
improvements on jetstream2 on macOS.
Updated•4 months ago
|
Comment 3•4 months ago
|
||
bugherder |
Description
•