Optimize array.copy for the different kinds of value types
Categories
(Core :: JavaScript: WebAssembly, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox134 | --- | fixed |
People
(Reporter: yury, Assigned: yury)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
The array.copy
instruction is very hot in GC applications and shows up in profiles. We currently do it with an instance builtin call [1] that is very generic and could be optimized quite a bit.
I think first generating a different Instance::arrayCopyX for {i8, i16, i32, i64, f32, f64, ref} and call the right one depending on the type of array.copy instruction would go a long way.
After that we could consider emitting some inline code if we think that would help.
Assignee | ||
Comment 1•10 months ago
|
||
For barista3 test I profiled it for count of instructions. The existing code spends 32,623,195 ins in the function that is doing array.copy, after the change the number drops to 6,918,427 ins (4 times less). The latest code relies on numElements != 0 check, and if we remove it, the function executes 11,761,813 ins -- it's recommended to keep the check.
Assignee | ||
Comment 2•10 months ago
|
||
The patch changes how barriers are invoked.
Expose native array memory and refs copy operations.
Description
•