A build loads the program twice per island round, each load a cold tsc-ts server
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- build-system, compilers
Direzione di ricerca
Start in packages/compiler/src/index.ts (around line 492), where each createFrontend builds its own FrontendServices, and in frontend/services.ts (createProgramHost, reuseProgramHosts). Then read executable/prepare.ts, where the island scan and island package frontends are created and disposed (around lines 84 and 103) and the retry recurses (around lines 190 and 220). Run the build with SCRIPTC_TIMING=1 to see the frontend-load counts. Done means one FrontendServices per frontend-process, so the reload and retry rounds reuse warm hosts. This is design-heavy and overlaps with the graph-islands work in #2807, so coordinate with maintainers first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A build starts a fresh tsc-ts server for every frontend load and loads the program twice per island round
Measurements
scriptc build packages/coding-agent/src/cli.ts --node-islands=auto --npm-static <14 packages> (pi), SCRIPTC_TIMING=1, 8 vCPU Sandbox, cold cache, on main + #2807 (bc19267d9 + the coverage fix; builds are unaffected by it):
| phase | round 1 | round 2 | round 3 |
|---|---|---|---|
frontend-load |
159.0 s | 169.4 s | 159.2 s |
frontend-island-reload |
100.7 s | 105.2 s | 62.4 s |
lower |
26.4 s | 20.6 s | — (build failed after the reload) |
- The whole build is one
frontend-process: 803.4 s, totalbuild time=804.14s, peak RSS 2.8 GB, rc=1 (96 diagnostics). - Loading is 756 s of the 803 s (94%); lowering is 47 s.
- A per-3 s process sample counted 83 distinct
tsc-tsprocesses during the build (median life 18 s: 35 lived ≤6 s, 26 7–21 s, 9 22–60 s, 13 >60 s), at most 3 at once.
Why
Every createFrontend call builds its own FrontendServices (packages/compiler/src/index.ts:492), which owns the program hosts and their tsc-ts connections (frontend/services.ts, createProgramHost). #2650's reuse (reuseProgramHosts(PROGRAM_HOST_LOADS)) lets a host serve up to 4 loads inside one FrontendServices, so it never spans the loads that matter:
executable/prepare.ts:84creates a frontend withislandScan,prepare.ts:103disposes it and creates a second one withislandPackages— the same round loads the program twice, on two cold servers, each re-typechecking the whole program and its libraries.- The island retry recurses into
prepareExecutableModule(prepare.ts:190,:220) with the grown set, which starts the pair over: another two cold loads, another two servers. - The remaining short-lived servers are helpers rooted at the entry's directory (
--cwd …/packages/coding-agent/src; 7 distinct in a 167 s window against 14 rooted at the project), one fresh process each.
The same shape cost the coverage analysis a second full lowering on pi; #2807 removes that one by deciding graph-proven islands before the first lowering (node-islands/graph-islands.ts).
Directions
- Share one
FrontendServicesper build (i.e. perfrontend-process) instead of one percreateFrontend, so the island reload and the retry rounds rebind idle hosts instead of starting cold servers. - Decide the graph-proven islands before the first load, as #2771 does for builds, so most rounds disappear rather than becoming cheaper.
- Lingua principale
- TypeScript
- Stelle
- 6.4k
- Fork
- 204
- Merge medio
- 9h 48m
- PR unite (30g)
- 795
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel-labs/scriptc
-
Promise.all result is treated as possibly undefined, widening mapped rowsForse già presa @alantriesagain l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 47/100
vercel-labs/scriptc#3080 ·
I maintainer di solito rispondono entro 1 giorno
-
Async function with a typed result rejects a returned checked-dynamic promiseForse già presa @alantriesagain l’ha presa oggi. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
vercel-labs/scriptc#3078 ·
I maintainer di solito rispondono entro 1 giorno
-
Abstract methods block coverage and direct calls when no subclass existsForse già presa @alantriesagain l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
vercel-labs/scriptc#3077 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
vercel-labs/scriptc#3048 ·
I maintainer di solito rispondono entro 1 giorno
-
Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)Forse già presa @ctate l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vercel-labs/scriptc#2949 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel-labs/scriptc
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
binding:python bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
coollabsio/orbit#72 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage potential-regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aws/aws-sdk-js-v3#8408 ·
I maintainer di solito rispondono entro 1 giorno