Skip to content

Cache Rust builds and remove ineffective thin LTO - #206

Merged
rob-p merged 2 commits into
mainfrom
perf/cache-builds-and-drop-lto
Aug 15, 2026
Merged

Cache Rust builds and remove ineffective thin LTO#206
rob-p merged 2 commits into
mainfrom
perf/cache-builds-and-drop-lto

Conversation

@rob-p

@rob-p rob-p commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • cache Rust dependency artifacts in the regular Linux/macOS CI matrix
  • enable cargo-dist's supported per-target release-build cache and regenerate the 0.31 workflow
  • remove thin LTO from release and distribution builds
  • remove simpleaf's unused direct cc dependency (cc remains transitively where native builds need it)
  • move checkout, Rust setup, and setup-miniconda to their supported Node 24-era actions

The cache deliberately leaves the simpleaf crate itself uncached. Rust-cache keys dependency artifacts by runner, toolchain, Cargo manifests/lockfile, and compiler environment. Release caching is declared through cache-builds in dist-workspace.toml, rather than as a hand edit to generated CI.

LTO measurement

Controlled clean-target release builds used the same checkout, host, Rust toolchain, and 16-way build:

configuration wall peak RSS unstripped binary stripped xz
thin LTO 101.89 s 4,142,812 KiB 128,445,728 B 15,726,188 B
LTO off 95.58 s 3,643,372 KiB 129,739,680 B 15,541,484 B

Disabling thin LTO reduced wall time by 6.2% and peak compiler RSS by 12.1%. The distributable-size proxy was 1.2% smaller without LTO.

Five alternating 1,000-process batches showed no measurable runtime change: median quant-help time was 1.84 s for both binaries, and median chemistry-registry load/lookup time was 1.80 s for both. Because simpleaf delegates mapping, collation, quantification, and index construction to child programs, there is no demonstrated end-user runtime benefit to pay for thin LTO here.

CI cache measurement

An identical rerun of the final commit, after its cache-seeding run completed, produced:

runner cold warm reduction
ubuntu-latest 16m25s 2m49s 82.8%
macos-15 13m01s 2m21s 81.9%

Both warm jobs ran the full workflow, including release build/tests, strict rustdoc on Linux, conda environment setup, the released alevin-fry artifact, and the toy end-to-end pipeline. The cache archives were 858 MB on Linux and 516 MB on macOS.

Validation

  • all 77 release-profile tests pass
  • strict rustdoc passes
  • Cargo metadata resolves with the lockfile
  • both workflows parse as YAML
  • cargo-dist 0.31 regenerates the release workflow cleanly and generate --check passes

@rob-p
rob-p merged commit 90a33e4 into main Aug 15, 2026
9 checks passed
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