perf: borrow instruction stream across unbudgeted tail dispatch - #64
Open
matthargett wants to merge 1 commit into
Open
matthargett wants to merge 1 commit into
matthargett wants to merge 1 commit into
Conversation
matthargett
force-pushed
the
perf/borrow-instruction-stream
branch
from
September 25, 2026 04:21
b6df12d to
50f7340
Compare
matthargett
force-pushed
the
perf/borrow-instruction-stream
branch
from
September 25, 2026 20:34
50f7340 to
3f7ea9c
Compare
matthargett
marked this pull request as ready for review
September 26, 2026 21:45
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: standalone tail-dispatch change on
next. This PR no longer depends on the closed #63.Unbudgeted tail dispatch borrows the current function's instruction slice across opcode handlers and retains its
Shared<WasmFunction>owner. It rebinds only after a function switch. Fuel/time-budgeted dispatch is unchanged, and no unsafe code is added. A focused test covers linked modules, a host import, indirect calls, returns, and fuel suspension.Measured against current
next(693d590) on the efficiency cores of an iPhone 12 (A14), iPhone XS Max (A12) and iPhone SE (A13); each cell is the change in cycles per call, median of five interleaved launches per build:note that the call_indirect benchmark regression on A12 (iPhone XS) is something I've seen before with wasmtime/WAMR benchmarking+optimization, and it's due to the efficiency cores on that silicon having much weaker branch prediction. it ended up being a "nice to have" once the relaxed simd128 lowering was optimized, though: under WAMR, xmrsplayer as WASM bundle was able to play a 16-track ScreamTracker3 module without sound skips or thermal throttling. so, in the words of The Guide, Don't Panic :D