Skip to content

perf(release): switch the release profile from fat to thin LTO - #16

Merged
vyncint merged 1 commit into
mainfrom
perf/thin-lto-release-profile
Sep 7, 2026
Merged

perf(release): switch the release profile from fat to thin LTO#16
vyncint merged 1 commit into
mainfrom
perf/thin-lto-release-profile

Conversation

@vyncint

@vyncint vyncint commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Today

Fat LTO with one codegen unit makes each binary's link a 13.6 GB whole-program pass. Cargo links the three binaries in parallel, so the 16 GB Linux release runners died with exit 143 on v0.1.0 and v0.1.2 (fixed by linking serially in #15), and the 7 GB macOS runners swapped for 4h11m and 4h37m per target on v0.1.0. Their v0.1.2 jobs were cancelled after 2h31m. With serial links a single fat link still needs 13.6 GB, so macOS would keep swapping.

Measured

Cold builds of the three binaries on Apple Silicon (12 cores, 24 GB), /usr/bin/time -l peak RSS of the largest process:

Profile Build Peak memory oxide oxide-scheduler oxide-worker
fat, 1 cgu (before) 11m57s 13.6 GB 68 MB 66 MB 48 MB
thin, 1 cgu (this PR) 5m22s 7.4 GB 74 MB 72 MB 53 MB
thin, 16 cgu 7m22s 2.6 GB 120 MB 111 MB 72 MB

A 10M-row GROUP BY aggregate (SUM, AVG, COUNT) ran in about 40 ms under all three, four alternating runs each. That workload is too small to separate them; it shows no regression, not a measured equivalence.

Change

  • [profile.release] lto = "thin", codegen-units = 1 unchanged, with the numbers in the comment.
  • binaries.yml: timeout-minutes: 90, comment updated. The one-link-at-a-time loop stays, since three 7.4 GB links still exceed 16 GB.
  • docs/SPEC.md and ADR-0008 quote the profile; updated.
  • CHANGELOG under [Unreleased]; ships as v0.1.3.

Not done

  • No runtime benchmark beyond the 10M-row aggregate. If a larger workload shows fat LTO earning its cost, the alternative is keeping fat and moving the macOS targets to 14 GB runners.
  • The 7.4 GB peak was measured with 12 LTO threads; the 3-core macOS runner will peak lower but that is not measured here. The v0.1.3 binaries run is the measurement; if it still swaps, the fallback is 16 codegen units.

Fat LTO with one codegen unit made each binary's link a 13.6 GB
whole-program pass over Arrow, DataFusion and Ballista (peak RSS of the
largest rustc, measured 2026-09-07 on Apple Silicon). Cargo links the
three binaries in parallel, so the 16 GB Linux release runners were torn
down with exit 143 on v0.1.0 and v0.1.2, and the 7 GB macOS runners
swapped for 4h11m and 4h37m per target on v0.1.0; their v0.1.2 jobs were
cancelled after 2h31m.

Measured on the same machine, cold builds of the three binaries:

  fat,  1 codegen unit:  11m57s, peak 13.6 GB, oxide 68 MB
  thin, 1 codegen unit:   5m22s, peak  7.4 GB, oxide 74 MB
  thin, 16 codegen units: 7m22s, peak  2.6 GB, oxide 120 MB

A 10M-row GROUP BY aggregate ran in about 40 ms under all three; the
workload is too small to separate them, and no regression was visible.
Thin LTO with one codegen unit keeps 91% of fat's binary size and halves
the link, so that is the profile. Sixteen units would fit comfortably
everywhere but cost 75% in size; it stays the documented fallback if the
macOS runners still swap.

binaries.yml gains a 90-minute timeout so a swapping link fails loudly,
and its comment now records the thin-profile peak. The one-link-at-a-time
loop stays: three 7.4 GB links still exceed 16 GB. SPEC.md and ADR-0008
quote the profile and are updated.

Not done: no runtime benchmark larger than the 10M-row aggregate; the
first release build under this profile is the measurement for the
runners.

Signed-off-by: Vyncint Ng <vyncint@icloud.com>
@vyncint
vyncint merged commit 579269d into main Sep 7, 2026
15 checks passed
@vyncint
vyncint deleted the perf/thin-lto-release-profile branch September 7, 2026 09:15
@vyncint vyncint mentioned this pull request Sep 7, 2026
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