Skip to content

Optimizing call_indirect performance #6429

@fitzgen

Description

@fitzgen

Ideas from a brainstorming session with some Cranelift folks:

  • 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”
  • Catch calls to null via signal rather than explicit check
  • Inline VMFuncRefs into table, instead of having table be a vec of pointers to VMFuncRefs
  • Store defined tables directly in the vmctx, rather than indirectly
    • Only works for max size tables
    • Helps with allocating multiple tables inside pooling allocator
  • If min and max are equal then table size is constant, don’t load table size from memory, just use the constant
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generatorcranelift:wasmperformancewasmtimeIssues about wasmtime that don't fall into another label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions