bytecodealliance / bytecodealliance/wasmtime

Optimizing `call_indirect` performance

Open
#6,429 1 comment 1 reaction 0 assignees View on GitHub
cranelift cranelift:wasm performance wasmtime
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

Ideas from a brainstorming session with some Cranelift folks:

* [x] Typed funcrefs can statically remove null checks and sig checks; but how do we use?
* In `cranelift-wasm`, need to feed type info from validator to say “non-null”
* [x] Catch calls to null via signal rather than explicit check
* [ ] Inline `VMFuncRef`s into table, instead of having table be a vec of pointers to `VMFuncRef`s
* [ ] Store defined tables directly in the vmctx, rather than indirectly
* Only works for max size tables
* Helps with allocating multiple tables inside pooling allocator
* [x] If min and max are equal then table size is constant, don’t load table size from memory, just use the constant
* [x] If table index is constant and less than minimum, skip bounds check

And, of course, it would be nice to have some (micro) benchmarks to measure all of this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.