perf(generator): generate chrome, decoys, and 404 concurrently#5
Open
JoshuaBearup wants to merge 1 commit into
Open
perf(generator): generate chrome, decoys, and 404 concurrently#5JoshuaBearup wants to merge 1 commit into
JoshuaBearup wants to merge 1 commit into
Conversation
Chrome, the decoy pages, and the 404 page each depend only on (theme,
scenario) — both ready before this stage — and not on each other, but
they were generated serially (chrome, then decoys, then 404). Run all
three in a single Promise.all so the stage's wall-clock drops from
chrome + decoys + 404 to max(chrome, decoys, 404).
No behaviour change: the chrome {BODY}/chromeInjection post-processing
and fail-fast assertion still run after generation, per-decoy failures
are still caught individually, and a chrome or 404 failure is still
fatal exactly as before.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Generate the chrome shell, the decoy pages, and the 404 page concurrently instead of one after another.
Why
In
generator/deploy.mjsthese three steps ran serially ([3/5] chrome,[4/5] decoys,[5/5] 404). But each depends only onthemeandscenario— both already resolved before this stage — and none depends on the others. Decoys were already internally parallel; chrome and 404 were not. Running them serially adds two extra LLM round-trips of latency per deploy for no reason.How
Wrap the three in a single
Promise.all. The stage's wall-clock drops fromchrome + decoys + 404tomax(chrome, decoys, 404).Behaviour is unchanged:
ensureChromeInjection+{BODY}fail-fast assertion still run, just after the parallel generation resolves.Promise.allrejection).Testing
node -cclean; confirmedchrome,decoys, andfallback404are still produced and consumed by the manifest unchanged. I couldn't run a full deploy end-to-end (noANTHROPIC_API_KEYin my environment), but this is a control-flow reorder of independent steps with no change to the calls themselves.