mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
Reusing the stored diagnostics of the declaration files scriptc supplies (lib-diagnostics.ts) needs those files' global names to tell whether a program's scripts could change what checking them reports. The first build that stored an answer collected them by reading every supplied file's syntax tree, which a program made only of modules does not otherwise read, and that build is every cold build. A program of modules cannot collide with those names, so its answer is now stored without them, and the first program with scripts that uses the answer collects them and stores them with it. The entry schema is scriptc.lib-diagnostics.v2. A cold dev build of the 17-module build benchmark takes 676 ms instead of 689 ms, and of the log-summary benchmark 375 ms instead of 396 ms, with peak RSS 5.7 MiB and 4.5 MiB lower.