Stream: git-wasmtime

Topic: wasmtime / PR #14468 component: Lower without fiber


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

adamrk opened PR #14468 from adamrk:abk/lower-without-fiber to bytecodealliance:main:

When lowering the result of a host function, we do the lowering on a separate fiber because it may call realloc which could yield and it's unsound for that to occur outside of a fiber.

But if we can determine from the result type that lowering will not realloc, then we can immediately lower in the host task future. This PR introduces that optimization.

I see a ~20% improvement in the benchmark for calling an async noop function which yields.

Baseline:

component-async/wasm-to-host-pending-once
                        time:   [2.0301 µs 2.0645 µs 2.1008 µs]

Branch:

component-async/wasm-to-host-pending-once
                        time:   [1.6673 µs 1.6984 µs 1.7309 µs]
                        change: [−22.923% −21.135% −19.370%] (p = 0.00 < 0.05)
                        Performance has improved.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

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

adamrk requested pchickey for a review on PR #14468.

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

adamrk requested wasmtime-core-reviewers for a review on PR #14468.

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

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

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

:thumbs_up: alexcrichton submitted PR review.

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

:speech_balloon: alexcrichton created PR review comment:

Could this perhaps pessimistically return true? The dynamic case is horribly slow for a bunch of other reasons and it additionally would mean that the environ changes above wouldn't be needed (if I'm undertanding this right)

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

adamrk updated PR #14468.

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

adamrk updated PR #14468.

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

:memo: adamrk submitted PR review.

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

:speech_balloon: adamrk created PR review comment:

Yep I removed the environ changes and just set this to be true in the DynamicHostFn case.

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

adamrk updated PR #14468.

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

adamrk updated PR #14468.

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

alexcrichton added PR #14468 component: Lower without fiber to the merge queue.

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

github-merge-queue[bot] removed PR #14468 component: Lower without fiber from the merge queue.

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

alexcrichton added PR #14468 component: Lower without fiber to the merge queue.

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

github-merge-queue[bot] removed PR #14468 component: Lower without fiber from the merge queue.

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

alexcrichton added PR #14468 component: Lower without fiber to the merge queue.

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

:check: alexcrichton merged PR #14468.

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

alexcrichton removed PR #14468 component: Lower without fiber from the merge queue.


Last updated: Oct 11 2026 at 02:20 UTC