perf(vapor): compile the three GB sdcc translation units in parallel - #394
Open
lfkdsk wants to merge 2 commits into
Open
perf(vapor): compile the three GB sdcc translation units in parallel#394lfkdsk wants to merge 2 commits into
lfkdsk wants to merge 2 commits into
Conversation
lfkdsk
force-pushed
the
fleet/vapor-gb-parallel-sdcc
branch
2 times, most recently
from
September 8, 2026 21:18
e7a1437 to
845b5a3
Compare
The units have no compile-time dependency and write distinct outputs, so dispatching them together cuts a full --target gb build from a median of 3108 ms to 1847 ms (-40.6%, n=15 each). All three .rel files, crt0.rel, app.ihx and todo.gb stay byte-identical to the serial build across 5 runs. Failures now have to be collected rather than thrown by the first await: report the failing unit in link order with sdcc's stderr attached, and delete the target .rel files up front so a stale one from an earlier build can never reach the link step. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
lfkdsk
force-pushed
the
fleet/vapor-gb-parallel-sdcc
branch
from
September 8, 2026 21:20
845b5a3 to
07ce66b
Compare
Contributor
Author
|
Rebased onto current |
lfkdsk
marked this pull request as ready for review
September 8, 2026 23:07
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.
What
buildGbRomcompiled its three sdcc translation units serially (vapor/compiler/rom.ts). The compiler stage is the bulk of a GB build — the Pocket Vapor compiler itself is ~6% of wall clock,typescript.jsload ~43%, external toolchains ~48% — so this runs the three units concurrently and keeps the link order unchanged.Measured
--target gbbuildSample ranges do not overlap (serial min 3073 ms > parallel max 1882 ms). The stage is now bounded by the slowest unit (
gen_app, ~1.6 s). On a single core the gain disappears (+1%), as expected.Correctness
.relfiles,crt0.rel, the intermediateapp.ihxand the finaltodo.gb(32768 B) are byte-identical to the serial build across 5 consecutive parallel builds.Promise.allSettleddoes not abort on the first failure the way the serialawaitloop did: failures are collected and re-thrown naming the unit, and the second commit (from the cross-family review) additionally removes partial.reloutputs and the stale final ROM on failure and preserves stdout-only diagnostics in link order.vapor/tests/gb-build.test.tswith an sdcc shim (per-unit delay, partial-output and stdout-only failure injection); seven guard-removal mutations each fail a distinct case.bun test vapor/tests/: 77 pass / 0 fail.Known limitation (pre-existing, not introduced here)
Two different apps building
--target gbinto the same output directory at the same time race on the sharedgen-gbintermediates; this was observable before this change and is left for a follow-up.Provenance
Autonomous fleet run: Scout-measured candidate (report on the fork branch
lfkdsk/pocketjs:fleet/scout-compile-time), Builder implementation, cross-family review that hardened failure handling on top.🤖 Generated with Claude Code