Release build of a large program needs more than 90 GB in scriptc-llvm-codegen, with no thread or memory limit
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- compilers, performance
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 6.6k
- フォーク
- 216
- 平均マージ
- 9時間 35分
- マージ済み PR(30日)
- 775
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel-labs/scriptc のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/scriptc#3979 ·
メンテナーはふだん 1 日以内に返信
-
Support undici 8.x request() through the built-in implementation対応中かも @younggglcy が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
vercel-labs/scriptc#3894 ·
メンテナーはふだん 1 日以内に返信
-
A native program crashes with SIGSEGV when a string or JSON builder grows past 4 MiB対応中かも @alantriesagain が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 22/100
vercel-labs/scriptc#3642 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
vercel-labs/scriptc#3605 ·
メンテナーはふだん 1 日以内に返信
-
Native CLI (scriptc.exe) segfaults on a large program that the same release compiles under Nodeオープン
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
vercel-labs/scriptc#3595 ·
メンテナーはふだん 1 日以内に返信
vercel-labs/scriptc の issue をすべて見る
似ている issue
-
truapi-release
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
paritytech/product-sdk#529 ·
メンテナーはふだん 1 日以内に返信
-
Environments table lists page size 5 after 30対応中かも @raus7n が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
litmuschaos/litmus#5743 ·
メンテナーはふだん 2 日以内に返信
-
desktop grp:admin-donors type:graphics-bug ui-admin
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
milind-soni/OpenMausBot#6730 ·
メンテナーはふだん 1 日以内に返信
-
Status: Triage Type: Bug / Error
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
mermaid-js/mermaid-v13#1059 ·
メンテナーはふだん 1 日以内に返信