Stream: git-wasmtime

Topic: wasmtime / PR #14517 Don't instantiate concurrent hostcal...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2026 at 19:08):

Sandvoxel opened PR #14517 from Sandvoxel:component-host-glue-mono to bytecodealliance:main:

HostFn::run returned a HostResult enum with a Future variant, so the sync and async lowering paths always contained the poll_and_block and first_poll arms. Those are monomorphized per host closure, so every func_wrap, func_wrap_async, func_new and func_new_async host function compiled its own copy of the future path, even though only the concurrent constructors can return a future.

This replaces the enum with a small HostOutput trait implemented for Result and for the boxed future. Only the future impl calls poll_and_block and first_poll, so they're only compiled for concurrent host functions. No public API or behavior change.

For the wasmtime CLI this cuts the wasmtime-cli crate's LLVM IR by 26% (7.4M to 5.5M lines), its peak compile memory from 3.3 GB to 2.5 GB, and the release binary from 65.8 MB to 60.8 MB. On an embedder with around 2,000 bindgen imports the fat LTO link peak went from 18.6 GB to 16.4 GB.

This overlaps a little with #13876. Its poll_once fast path would move into the future impl.

Testing

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2026 at 19:08):

Sandvoxel requested dicej for a review on PR #14517.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2026 at 19:08):

Sandvoxel requested wasmtime-core-reviewers for a review on PR #14517.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2026 at 23:32):

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

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

:thumbs_up: dicej submitted PR review:

Thanks, @Sandvoxel!

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

dicej added PR #14517 Don't instantiate concurrent hostcall glue for non-concurrent host functions to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2026 at 15:29):

:check: dicej merged PR #14517.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2026 at 15:29):

dicej removed PR #14517 Don't instantiate concurrent hostcall glue for non-concurrent host functions from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2026 at 17:37):

QuantumSegfault commented on PR #14517:

@alexcrichton

Could we get this backported for the upcoming 50 release?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2026 at 14:28):

alexcrichton commented on PR #14517:

Sure thing, done at https://github.com/bytecodealliance/wasmtime/pull/14604


Last updated: Oct 11 2026 at 04:10 UTC