[codex] Prewarm route transform workers#61
Draft
ScriptedAlchemy wants to merge 3 commits into
Draft
Conversation
commit: |
Contributor
Benchmark ResultsCompared PR head Total median wall time: 12.24s -> 12.10s (-1.1%, 1.01x speedup)
Profile: |
…to codex/prewarm-route-workers
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.
Summary
onAfterCreateCompilerin dev mode, before lazy route compilation requests hit the executor.Why
The first parallel transform implementation could defer web/node environment builds, but route transform workers still had a startup cliff. Pure lazy worker slots improved initial dev server readiness, but browsing into lazy-compiled routes could still pay worker creation cost. I tested full-pool and yielded/batched prewarm variants to find the best tradeoff.
Benchmark Notes
Large dev benchmark medians from local runs on this machine:
onAfterCreateCompileronBeforeDevCompileonAfterCreateCompilerfull-pool prewarm was the best overall choice: fastest median wall and ready time among the tried prewarm variants, with better p95 than lazy-only, while avoiding lazy route requests being the first thing to create worker slots.Validation
pnpm exec tsc --noEmitpnpm test tests/parallel-route-transforms.test.ts tests/index.test.ts tests/features.test.ts tests/build-output-transforms.test.tspnpm buildgit diff --check