Consider using WasmArray
s in maps and related data structures
#54961
Labels
area-dart2wasm
Issues for the dart2wasm compiler.
In dart2wasm we currently use VM's base implementation for linked hash maps (
_HashFieldBase
with various mixins). The VMs implementation usesUint32List
for the index and non-growableList<Object?>
for the data. This means means a map object in wasm consists actually of 5 objects we can reduce that to 3 objects by usingWasmArray<>
s for index + data. This also avoids extra cost on the indirect access.The downside is we depart from sharing the code with VM, but we can still use shared mixins and try to keep in sync in their implementation.
There's associated data structures, e.g. iterators, that are similarly affected
/cc @osa1
The text was updated successfully, but these errors were encountered: