perf: switch release builds to Thin LTO - #464
Merged
Mohamed Mansour (mohamedmansour) merged 1 commit intoAug 21, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mohamed Mansour (mohamedmansour)
requested review from
a team and
Bang Lee (Qusic)
August 21, 2026 20:13
Todd Reifsteck (toddreifsteck)
approved these changes
Aug 21, 2026
mcritzjam
approved these changes
Aug 21, 2026
Mohamed Mansour (mohamedmansour)
merged commit Aug 21, 2026
d3d9221
into
microsoft:main
24 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Full LTO (
lto = true) in the release profile delivers maximum cross-crate optimization but at a steep cold-build-time cost. This PR switches the release profile to Thin LTO (lto = "thin"), which still performs cross-crate LTO (unlikelto = false/no LTO, or per-codegen-unit "thin local" LTO) but with a faster, more parallelizable linking pipeline.codegen-units = 1is retained so cross-crate inlining and optimization opportunities are not reduced by unit fragmentation.This is a standalone follow-up scoped strictly to the LTO mode itself — no CI matrix, SDK, platform-support, packaging, macOS/Windows, README, or DESIGN.md changes are included.
Changes
Cargo.toml:[profile.release] lto = true->lto = "thin"(keepscodegen-units = 1,panic = "abort",strip = trueunchanged)..github/copilot-instructions.md: updated the release-profile code snippet and surrounding prose to accurately describe Thin LTO instead of full LTO.xtask/src/main.rs: updated the benchmark-validation step's comment referencinglto = truetolto = "thin", and adjusted the accompanying explanation of why the bench-profile smoke test is skipped in favor of the dev profile.Measured results (release build, this environment)
true)"thin")Render/1000(criterion)RenderFAST/1000(criterion)Takeaways:
--releaseiteration and CI release builds.Validation
cargo xtask check(license-headers, fmt, clippy, deny, test, build, build (wasm), build (examples), bench (validate), docs) passes cleanly on this branch.origin/mainwith 0 commits ahead/behind at the merge-base, and contains no cross-compilation-related changes.Cargo.toml,.github/copilot-instructions.md,xtask/src/main.rs) — no CI matrix, SDK, platform-support, packaging, macOS/Windows, README, or DESIGN.md changes.