Skip to content

biome: thin LTO under the detbuild shim instead of fat LTO - #1740

Open
bryan-minimal wants to merge 1 commit into
mainfrom
biome-build-speed
Open

bryan-minimal wants to merge 1 commit into
mainfrom
biome-build-speed

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

Upstream biome's .cargo/config.toml sets [profile.release] lto = true (fat LTO). Fat LTO runs the final optimisation of the whole crate graph on one core. This PR:

The CVE-2026-111943 lock patch and its checks, BIOME_VERSION, and --remap-path-prefix are unchanged.

Why

biome takes about 32 min (one arch) and 25 min (the other) on the build-bot. Most of that is the serial fat-LTO link.

Build time

before (main) this PR
build-bot arm64 wall / CPU 1136–1291 s / ~2400 s 185 s / 2657 s
build-bot amd64 wall / CPU 1151–1856 s / 2550–3490 s 204 s / 4246 s
build-bot artifact bytes ~58–60 MB 76 MB
local min box (6 CPU), two runs - 342 s, 327 s

Build-bot numbers come from res-server's wall_s / cpu_lower_bound_s journal fields. The baseline is main's builds from the last 2 days; this PR's are from run e4e1ce24.

Reproducibility evidence

I ran two clean local --rebuilds, each in a freshly activated session (arm64):

  • run 1: d55f45796bc0daa22c2c2e3a2dfe0bf5a837f43353606679bd3b4ea28ce5b66a, 193,544,520 B
  • run 2: d55f45796bc0daa22c2c2e3a2dfe0bf5a837f43353606679bd3b4ea28ce5b66a, 193,544,520 B

The two binaries are byte-identical.

The artifact is about 30% larger, which is the usual cost of thin LTO compared with fat LTO.

Runtime trade-off

Fat LTO usually gives a binary a few percent faster than thin LTO. For a linter/formatter CLI, that is worth less than a build several times faster, so this PR accepts it, as #1713 did for codex.

🤖 Generated with Claude Code

Upstream's .cargo/config.toml sets [profile.release] lto = true, which runs the
whole crate graph's final optimisation on one core (~32/25 min on the
build-bot). Override it to thin LTO, add v0 mangling, fetch crates first, and
run the now-offline build under packages/detbuild, the codex recipe (#1713).
build.sh echoes the binary's sha256 so two builds can be compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 48 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 59 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f44b00d and 0540f31.

Files selected for processing: 2

  • packages/biome/build.ncl
  • packages/biome/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal

Copy link
Copy Markdown
Member Author

Build-bot minimal build green (run e4e1ce24): wall arm64 185 s (was 1136–1291 s), amd64 204 s (was 1151–1856 s). Local double build sha256 d55f4579…5b66a both runs (193,544,520 B), byte-identical.

@bryan-minimal
bryan-minimal marked this pull request as ready for review November 26, 2026 22:07
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 26, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant