Repository navigation
Description
This was generated by AI during triage.
Agent Brief
Category: enhancement
Summary: Add the measured build-speed experiments to the Rust build profile research note, and correct its suggestion to switch rustls to ring.
Current behavior:
The research note Where the Rust build's time goes (docs/research/rust-build-profile.md, added in #1866) profiles a cold dev build and an edit rebuild. It has two problems:
- It suggests switching the TLS crypto provider to
ringto stop buildingaws-lc-sys. Stop building aws-lc-sys, and axoupdater's image stack if a flag allows #203 already found that this does not work alone.axoupdaterturns on reqwest'sdefault-tls, features unify, and aws-lc builds anyway; the comment above theaxoupdaterdependency inCargo.tomlexplains this. Only replacing the updater (Replace axoupdater with a small verified updater #1592) removes aws-lc. - It lists a faster linker, the Cranelift backend and a workspace split as untried options, and says no improvement has been measured.
Desired behavior:
The note corrects the ring paragraph as above, linking #203, #1592 and the Cargo.toml comment. It also gains an Experiments section with the measurements below and their conclusions. It keeps the existing style: plain prose, cited sources, and a Limits section. ADR-0001 stays unchanged.
Measurements, taken 2026-11-09 in the Lima VM (Ubuntu 24.04 aarch64, 4 vCPUs, 8 GiB, rustc 1.99.1) on a scratch Worktree at 82f88ec8:
- Each time is wall-clock seconds around
cargo build -q --bin thirdshift. - Each edit appended a comment to the Ticket run module (
src/run.rs). - The first build after changing
RUSTFLAGSrebuilds every crate, so it is left out of the edit column. - Nothing from these trees was committed.
| Variant | Cold build (s) | Edit rebuild (s) |
|---|---|---|
Baseline (system cc, GNU ld) |
58.7 | 7.0, 7.0, 7.0 |
-C link-arg=-fuse-ld=lld |
4.0, 4.2 | |
-C link-arg=-fuse-ld=mold |
3.8, 4.5 | |
No axoupdater, reqwest on ring |
42.4 | 6.8, 6.0, 6.5 |
| Nightly 1.102.0 (2026-11-08), LLVM backend | 62.2 | 7.1, 6.8, 6.7 |
| Nightly, LLVM + lld | 4.0, 4.4 | |
| Nightly, Cranelift backend | 57.0 | 6.2, 6.1, 6.2 |
| Nightly, Cranelift + lld | 4.0, 3.9 |
The "No axoupdater" variant is #1592's end state for the build only:
- It removed the
axoupdaterdependency. - It stubbed the update module's version check and update functions to return errors.
- It switched reqwest to
rustls-no-providerplus rustls 0.23 withringandstd. cargo tree -i aws-lc-systhen found nothing.
It measures build weight, not a working updater.
Conclusions to record:
- Removing the updater's aws-lc saves about 16 s (28%) of a cold build, and nothing on an edit rebuild. The saving is less than the ~30 s build script because the remaining dependencies become the critical path. Every new Run Worktree and CI job pays a cold build.
- On this aarch64 host, lld or mold cuts the edit rebuild from about 7 s to about 4 s. The two are equivalent.
- This does not carry over to x86_64 hosts. Since Rust 1.90,
x86_64-unknown-linux-gnulinks with the bundledrust-lldby default (https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/), so the DigitalOcean measurements in Go prototype: reproducible Go vs. Rust benchmark runner and comparison report #1835 and TypeScript prototype: reproducible TypeScript vs. Rust benchmark runner and comparison report #1840 already used LLD. Adopting LLD on aarch64 Linux would mean a Cargo config entry for that target pluslldor mold installed on each such host. - Cranelift adds little once LLD is used. It still takes about 4 s, and it needs nightly, which the pinned
rust-toolchain.tomlrules out. - What remains of the edit loop is about 2 s of type checking and 2 s of code generation for the single
thirdshiftcrate. Only a smaller recompilation unit, such as a workspace split, targets that. A split has not been measured. - The Console test failure TypeScript prototype: reproducible TypeScript vs. Rust benchmark runner and comparison report #1840 reported is host-specific.
idle::unchanged_requests_reuse_retained_records_but_replacements_are_visiblepassed in this VM. Mention this only if it fits; it is optional.
The Limits section should say: one to three samples per measurement, on a 4-vCPU aarch64 VM; a single trailing-comment edit; no workspace split measured.
Key interfaces:
- Only the research note changes. Its existing Method and Results sections (the 65.6 s cold build and the
--timingsbreakdown) stay as they are.
Acceptance criteria:
- The note no longer presents switching reqwest to
ringas a way to stop building aws-lc. It says why, citing Stop building aws-lc-sys, and axoupdater's image stack if a flag allows #203, Replace axoupdater with a small verified updater #1592 and theCargo.tomlcomment. - An Experiments section reproduces the table above, with the method details: host, revision, how edits were made, and the excluded first build after a
RUSTFLAGSchange. - The note states that x86_64 Linux already links with LLD by default since Rust 1.90, with a link to the Rust 1.90.0 announcement, and that the linker saving applies to aarch64 hosts.
- The Limits section no longer says no improvement has been measured.
- No files other than the research note change.
Out of scope:
- Changing
Cargo.toml, adding a.cargo/config.toml, or replacingaxoupdater; Replace axoupdater with a small verified updater #1592 covers the updater. - Re-running the measurements. The numbers above are the evidence, and the PR should say they came from this issue.
- Editing the Go or TypeScript comparison reports, or ADR-0001.
Activity