Release build of a large program needs more than 90 GB in scriptc-llvm-codegen, with no thread or memory limit
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- compilers, performance
Direzione di ricerca
This is a memory-profiling and design task, not a one-file edit. Start by reproducing the failure with the reported command on a large TypeScript program under a memory cap, then read the scriptc-llvm-codegen helper to find where it spawns one compile thread per hardware thread; the cached .bc/.o partitions under ~/.cache/scriptc/build/native-v1/partitions/<hash>/ show what a release partition produces. A first deliverable is a --jobs flag or SCRIPTC_CODEGEN_JOBS env var threaded through scriptc build, plus measurements of peak memory per thread at 4, 8 and 32 jobs. Done means the cap holds at a documented thread count and the option is in scriptc build --help.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A release build of a large program needs more than 90 GB of memory in scriptc-llvm-codegen, and there is no setting to lower its parallelism.
The program is the Paseo CLI (TypeScript; zod, commander and a WebSocket client among its dependencies), built on Linux x86-64 with 32 hardware threads and 123 GB of RAM:
scriptc build index.ts -o paseo --optimization release --no-keep-llvm --node-islands=off
Each build ran alone under a systemd memory cap (MemoryMax, MemorySwapMax=0), scriptc 0.4.10:
| Optimization | Cap | Result |
|---|---|---|
| dev | 40 GB | killed |
| dev | 48 GB | built in 8 min |
| release | 32 GB | killed |
| release | 60 GB | killed, both with 32 CPUs and with 8 CPUs |
| release | 90 GB | killed in scriptc-llvm-codegen after 13 min, with 4 h 50 min of CPU time |
The release cache directory (~/.cache/scriptc/build/native-v1/partitions/<hash>/) holds 191 .bc and 202 .o files, 3.4 GB in total, after these attempts.
The helper starts one compile thread per hardware thread. I have not measured how the peak splits between threads; the 8 CPU run at 60 GB failed too, so the thread count may not be the whole cause. I found no option, in scriptc build --help or in the helper, that limits threads or memory.
Requests:
- A way to set the number of codegen threads, for example
--jobsorSCRIPTC_CODEGEN_JOBS, so a build can trade time for memory. - If a release partition is expected to need several GB, a peak memory that does not grow with the thread count.
I can run a build with extra logging or a different scriptc version if that helps.
- Lingua principale
- TypeScript
- Stelle
- 6.6k
- Fork
- 216
- Merge medio
- 9h 35m
- PR unite (30g)
- 775
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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel-labs/scriptc#3979 ·
I maintainer di solito rispondono entro 1 giorno
-
Support undici 8.x request() through the built-in implementationForse già presa @younggglcy l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vercel-labs/scriptc#3894 ·
I maintainer di solito rispondono entro 1 giorno
-
A native program crashes with SIGSEGV when a string or JSON builder grows past 4 MiBForse già presa @alantriesagain l’ha presa 5 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 22/100
vercel-labs/scriptc#3642 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
vercel-labs/scriptc#3605 ·
I maintainer di solito rispondono entro 1 giorno
-
Native CLI (scriptc.exe) segfaults on a large program that the same release compiles under NodeAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
vercel-labs/scriptc#3595 ·
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 75/100
milind-soni/OpenMausBot#6730 ·
I maintainer di solito rispondono entro 1 giorno
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)Apertaarea: @angular/build
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
angular/angular-cli#34764 ·
I maintainer di solito rispondono entro 1 giorno
-
status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google-gemini/gemini-cli#30384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
area:image documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno