wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

List of future optimizations for Wasm GC performance

Open fitzgen opened this issue 1 year ago • 2 comments

This is a tracking issue collecting all of our ideas for improving Wasm GC performance and potential optimizations we could implement.

  • [ ] https://github.com/bytecodealliance/wasmtime/issues/9347
  • [ ] https://github.com/bytecodealliance/wasmtime/issues/9352
  • [x] https://github.com/bytecodealliance/wasmtime/issues/9350
  • [ ] https://github.com/bytecodealliance/wasmtime/issues/9349
  • [ ] https://github.com/bytecodealliance/wasmtime/issues/9348
  • [x] https://github.com/bytecodealliance/wasmtime/issues/5908
  • [x] Const fold through uadd_overflow_trap/trap{z,nz} insts that show up frequently in GC heap accesses. Depends on https://github.com/bytecodealliance/wasmtime/issues/5908
  • [x] Also add a mid-end rule like (uadd_overflow_trap (uextend x) (uextend y)) ==> (iadd (uextend x) (uextend y)). Depends on https://github.com/bytecodealliance/wasmtime/issues/5908
  • [ ] Use bulk memcpy-style APIs to implement array.copy when possible and do GC barriers inline when not possible
  • [ ] Expose type registry's supertypes arrays to Wasm, so it can do the O(1) subtype checks inline
  • [ ] Propagate trapz backwards from ref.cast into the branch-y instance-of check that it emits. Similar for the jumps inside a br_on_cast[_fail]'s instance-of check. See https://github.com/bytecodealliance/wasmtime/pull/9437#discussion_r1795656924 for details. Alternatively, clean this stuff up in the mid-end: https://github.com/bytecodealliance/wasmtime/issues/6106
  • [ ] Speed up call_indirect in the face of subtyping. Much of this can be addressed by letting Wasm to the O(1) subtype checks inline, but it is still additional work to be done on every call_indirect vs MVP wasm. We should investigate inline caches and such again.

fitzgen avatar Oct 01 '24 16:10 fitzgen

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "wasmtime:ref-types"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: wasmtime:ref-types

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

github-actions[bot] avatar Oct 01 '24 16:10 github-actions[bot]

See also https://github.com/WebAssembly/gc/issues/565 for potential benchmarks.

fitzgen avatar Oct 10 '24 21:10 fitzgen