mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-17 05:09:24 +08:00
Speed is a third native optimization posture next to release (default, -O2) and dev (-O0). It is optimized exactly like release at the C/LLVM level and is the switch for optimizations that trade executable size and build time for run-time speed, so the default release build stays inside the binary-size budget. - backend/optimization.ts: the NativeOptimization type, its -O class, and cache-key helpers. Release keeps its historical key shapes (absent). - CLI: build/run/cache warm accept speed; usage text names the trade. Bootstrap's routed executable cache mirrors the posture. - Early executable cache keys and native-feature validation include speed, so release, dev, and speed entries never satisfy one another. - Runtime packs: an optional executable `speed` flavor (-O2, only beside release). Speed links it when present and the release objects otherwise; library modes link their release flavor. The sanitizer lane follows the same flavor key. - Library profiles accept "speed". - WASI release-only linker flags apply to speed too. - bench-runtime: --baseline-optimization/--candidate-optimization and a per-contender cold_build_ms. Release executables are byte-identical to the stack tip for all 14 benchmark workloads (macOS arm64, sha256 of executables built from both trees).