Files
wasmtime/crates
Alex Crichton 2f494240f8 Lazily allocate the bump-alloc chunk in the externref table (#3739)
This commit updates the allocation of a `VMExternRefActivationsTable`
structure to perform zero malloc memory allocations. Previously it would
allocate a page-size of `chunk` plus some space in hash sets for future
insertions. The main trick here implemented is that after the first gc
during the slow path the fast chunk allocation is allocated and
configured.

The motivation for this PR is that given our recent work to further
refine and optimize the instantiation process this allocation started to
show up in a nontrivial fashion. Most modules today never touch this
table anyway as almost none of them use reference types, so the time
spent allocation and deallocating the table per-store was largely wasted
time.

Concretely on a microbenchmark this PR speeds up instantiation of a
module with one function by 30%, decreasing the instantiation cost from
1.8us to 1.2us. Overall a pretty minor win but when the instantiation
times we're measuring start being in the single-digit microseconds this
win ends up getting magnified!
2022-01-28 16:10:05 -06:00
..
2021-12-17 12:00:11 -08:00
2022-01-05 13:26:50 -06:00
2022-01-05 13:26:50 -06:00
2022-01-05 13:26:50 -06:00
2022-01-05 13:26:50 -06:00
2022-01-24 11:45:16 -08:00
2022-01-05 13:26:50 -06:00
2022-01-05 13:26:50 -06:00
2022-01-05 13:26:50 -06:00