Skip to content

Add a Cargo build profile for benchmarking#21574

Merged
zanie-oai merged 1 commit into
mainfrom
zb/profiling-build
May 7, 2026
Merged

Add a Cargo build profile for benchmarking#21574
zanie-oai merged 1 commit into
mainfrom
zb/profiling-build

Conversation

@zanie-oai
Copy link
Copy Markdown
Contributor

@zanie-oai zanie-oai commented May 7, 2026

A clean release build takes ~18m and an incremental build takes ~12m. This is far too slow to iterate on performance related changes and the build time is dominated by LTO.

This pull request adds a profiling profile for Cargo which takes ~13m clean and ~6m incremental, the primary change is that LTO is disabled. This matches a profile used in uv and follows the great work at astral-sh/uv#5955 — there's a bit of commentary there about the trade-offs this implies.

We've found that this does not inhibit the ability to accurately benchmark as measurements with LTO disabled are generally consistent with the results with LTO enabled and it makes it much faster (~2x) to rebuild after making a change.

This is motivated by my interest in improving Codex TUI performance, which is blocked by the tragically builds right now.

I tested incremental build times by making a no-op change to the codex-cli crate.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@zanie-oai
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 7, 2026
@zanie-oai zanie-oai requested review from bolinfest and gankra-oai May 7, 2026 20:12
Copy link
Copy Markdown
Contributor

@gankra-oai gankra-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this has always worked great for us.

@zanie-oai zanie-oai merged commit 27ec488 into main May 7, 2026
29 of 30 checks passed
@zanie-oai zanie-oai deleted the zb/profiling-build branch May 7, 2026 21:30
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants