Files
react/compiler/scripts
laurenandGitHub f609958e84 [rust-compiler] Add release profile: fat LTO, one codegen unit, strip (#36726)
The workspace has no `[profile.release]`, so the shipped napi binary
(`index.node`) is built on stock cargo defaults with the symbol table
retained: 11.2MB on arm64 macOS. Fat LTO + `codegen-units = 1` + `strip
= true` lands at 7.2MB with no runtime cost. Release builds get slower;
debug builds (`snap --rust`, the e2e harness) are unaffected.

`profile-rust-port.ts --release` overrides `strip` so profiling runs
keep symbol names.

Measured (arm64 macOS, `cargo build --release -p react_compiler_napi`):

| profile | size |
|---|---|
| defaults | 11.2MB |
| this PR | 7.2MB |

`opt-level = "s"` was measured and rejected: it cuts a further 2MB but
costs ~50% compile throughput (3.9s to 5.85s median compiling 598
fixtures through the release CLI).
2026-06-09 15:38:10 -07:00
..