Pack AvlTree::Node more tightly
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | fixed |
People
(Reporter: jlink, Assigned: jlink)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
I noticed AvlTree insertions and traversals showing up fairly prominently in some profiles of Ion compilation. The disassembly looked pretty good and the code is mainly just jumping around through memory so I suspected that the performance here might get better if we packed things better.
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The AvlTree is only used of the register allocator in IonCompilation. The register allocator is storing the ranges associated with the liveness of registers.
Julian would certainly know better what might be going on.
Updated•2 years ago
|
Comment 2•2 years ago
|
||
The AvlTrees are used by Ion's register allocator to keep track of register
commitments. There has already been considerable effort expended to make the
allocator as a whole faster, including improving the behaviour of the trees;
see for example bug 1814204.
More broadly, in bug 1758274 there was a lot of work on the allocator done,
none of which (directly) landed. There may a couple of optimisations that we
can pull from that work, which could be landed in the existing allocator. I
could have a look, but the results would be minor.
We know that the allocator is not cache friendly -- it causes a lot of misses
when processing large functions. That could be improved by changing the core
data structure(s) from linked lists to vectors, but that would be a major
piece of work. We know at least approximately what would need to happen
though, and Chris Fallin's RA2 allocator for Cranelift shows this is feasible.
If you have JS-shell test cases that show allocation slowness, I would be
happy to look at them to see if there is anything that can be done.
Assignee | ||
Comment 3•2 years ago
|
||
Perhaps I should mention that I do have a patch that improves the packing of AvlTree nodes and that shows pretty significant improvements in many SP3 subtests. I'm just working on cleaning it up and getting it ready for review. (To get a good view of the impact of the change, go to the subtests for each platform and select "Hide uncertain results".)
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Comment 6•2 years ago
|
||
bugherder |
Description
•