[Based on #134] runtime/wasmresume: reuse retained frame arenas - #142
Draft
cpunion wants to merge 3 commits into
Draft
[Based on #134] runtime/wasmresume: reuse retained frame arenas#142cpunion wants to merge 3 commits into
cpunion wants to merge 3 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
Compared only with the latest matching platform in the main series. |
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.
Depends on #134.
Implements the K2 frame-allocation stage of xgo-dev#2152. This keeps the resumable backend opt-in through
LLGO_WASM_RESUME=1.Problem
The K1 backend allocates and frees a GC-root block for almost every lowered call frame. A 10,000-round channel handoff therefore spends most of its time in frame storage management and creates about 20.7 KiB / 12 allocations per operation in the acceptance workload.
Design
frameBlockprefix. Block growth, retained-block selection, and reclamation remain runtime slow paths.noinline. Unrestricted inlining inflated J64/P1 outputs by 1.34/1.16 MiB; one helper per using package keeps the improvement without duplicating the helper at every call site.ContextABI at three pointer-sized words. Native and embedded targets do not emit these paths.Results
Five interleaved macOS arm64 runs of the J32 hardening workload (10,000 channel roundtrips, median):
K2 still takes 2.03x the Asyncify latency, so it does not yet satisfy the proposal's default-backend performance gate.
The final hardening workload reports about 80 B/op and 2.00 allocs/op, down from K1's about 20,739 B/op and 12.01 allocs/op.
Final artifact deltas against K1:
.mjs+.wasm).mjs+.wasm).wasm)Forced J32 build time was 43.790 s median versus K1's 43.281 s (+1.18%). Cortex-M4 output was byte-identical; macOS native text/data sizes were unchanged.
Validation
Resource bounds:
GOMAXPROCS=2,GOMEMLIMIT=4GiB,-p=1.internal/wasmresume: 95.2% statement coverageinternal/wasmresume: 92.0% statement coveragego test -p=1 ./internal/build ./ssa ./cl-O0,-O3, ThinLTO, full LTOnoinlinecode-size guardDiff against #134: 16 files, +726/-90 in three reviewable commits.