mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 14:43:13 +08:00
An executable with at least 4 MiB of program code is linked with 2 MiB segment alignment and published with one write, so the page cache holds its text in 2 MiB folios and the runtime advises huge pages for it. A run then maps every 2 MiB text window it touches whole. Most runs of the compiler are short: `scriptc --version` peaked at 76 MB and an unchanged rebuild at 78 MB, against 20 MB and 26 MB with 4 KiB alignment, and cold and edited builds of tsc-ts took the same time either way. compile() takes an internal `hugeText: false`, which links with 4 KiB alignment whatever the code size and is part of the executable cache key. scripts/build-native-cli.mts passes it. Executables the compiler builds keep huge text.