Stream: git-wasmtime

Topic: wasmtime / PR #13876 Component hostcall optimizations


view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 12:00):

tschneidereit opened PR #13876 from tschneidereit:hostcall-opts to bytecodealliance:main:

This set of commits applies a bunch of independent optimizations to calling host imports from components. In combination, they reduce overhead of sync calls by about 84%, from 83ns to 13ns, and that of immediately-ready async host imports by about 62%, from 142ns to 53ns. All numbers measured in a Linux VM on an M5 Max MBP, but I don't think any of this is particularly architecture-specific.

A few of notes on the results:

  1. I have a change to wit-bindgen pending that reduces guest-side overhead of async calls, bringing the 53ns down to something like 35ns.
  2. The fast paths introduced here only work for calls that don't involve borrows. I have changes pending that expand coverage and improve performance for calls involving borrows, but those need more vetting.
  3. Calls to async functions whose results aren't immediately ready are substantially slower, IIRC the last number I measured was about 700ns. There's more to be done there, but I didn't want to expand scope here too much.

All commits can be reviewed independently and come with improvement numbers relative to the previous commit.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 12:00):

tschneidereit requested dicej for a review on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 12:00):

tschneidereit requested wasmtime-core-reviewers for a review on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 13:05):

github-actions[bot] added the label wasmtime:api on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 13:31):

tschneidereit added the label performance on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 13:32):

tschneidereit added the label wasm-proposal:component-model on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 13:36):

tschneidereit updated PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 13:41):

tschneidereit updated PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 14:29):

alexcrichton commented on PR #13876:

Thanks! Could this be split up to land each commit independently? Some of these I'm more sure about than others and might take more time to review

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 14:29):

alexcrichton unassigned dicej from PR #13876 Component hostcall optimizations.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 14:29):

alexcrichton requested alexcrichton for a review on PR #13876.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 14:40):

tschneidereit commented on PR #13876:

Happy to do that, yes! I might in that case also restructure some of them a little bit to bring in some borrows-related fixes which change some of the new code again.


Last updated: Jul 29 2026 at 05:03 UTC