WasmArrayObject::create: don't create zero-sized payload blocks
Categories
(Core :: JavaScript: WebAssembly, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: jseward, Assigned: jseward)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
The Dart Barista-3 benchmark creates around 662,000 wasm-gc arrays. Of these,
308,000 have no elements (bizarrely); as a result we end up malloc-heap
allocating a zero-sized payload area for them. It would be better not to.
This changes an invariant for WasmArrayObject from "data pointer is never
null" to "data pointer is null iff the number of elements is zero". But
that's no big deal.
Assignee | ||
Comment 1•2 years ago
|
||
The Dart Barista-3 benchmark creates around 662,000 wasm-gc arrays. Of these,
308,000 have no elements (bizarrely); as a result we end up malloc-heap
allocating a zero-sized payload area for them. It would be better not to.
This patch changes WasmArrayObject::createArray so as to allocate the data
area only if the number of elements is non-zero. As a result the invariant
for WasmArrayObject "data pointer is never null" is changed to "data pointer
is null iff the number of elements is zero". But that's no big deal.
::obj_trace and ::obj_finalize are updated accordingly.
Comment 3•2 years ago
|
||
bugherder |
Description
•