Repository navigation
Use one codegen unit for release builds - #4692
Closed
charliermarsh wants to merge 3 commits into
Closed
charliermarsh wants to merge 3 commits into
charliermarsh wants to merge 3 commits into
Conversation
Member
Author
|
Closing this because the measured gains do not justify changing the release default. One codegen unit reduced binary size by 0.8–5.3% and sampled peak process memory by 23–26%, but combined PGO compilation took 24–27% longer in these runs. Runtime gains were modest in the tested source subsets, and the incremental language-server measurements did not establish an improvement. We have not identified a build-memory constraint that would make this tradeoff worthwhile. We'll keep the existing release configuration. The measurements and their limits remain in the description for reference. |
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.
Summary
One codegen unit produced smaller binaries and reduced peak compiler memory, but increased combined PGO compilation time by 24–27%. Runtime benefits were modest.
We compared a release default of 16 → 1 codegen units using Rust 1.99.0, fat LTO, and PGO on the same source revision:
Binary size fell by 0.8–5.3% and peak process memory by 23–26%. Compilation time includes the instrumented and final PGO builds. Each configuration was built once from a clean target directory on the same runner; build order and OS caches were not controlled. Linux measurements used native builds rather than the manylinux packaging container.
Runtime performance: We checked 11 pinned project source subsets, including two source trees excluded from training, across two rounds of 30 alternating pairs. Both binaries produced identical diagnostics. The PGO corpus uses sparse checkouts, so imports of omitted sibling packages remain unresolved; some optional dependencies are also absent. Runtime timings include rendering those diagnostics. The
astropy/unitssubset was consistently 0.7–2.4% faster. Other cases showed no repeatable regression; Windows results were noisier and sometimes changed direction between rounds. Single-thread Black and Warehouse medians were 0.2–1.3% faster on Linux and macOS; Windows results were inconclusive.In a two-file fixture with cross-file edits, both binaries returned identical language-server replies. Session latency changed little, and the edit-latency measurements did not establish a difference. Session timing includes startup and protocol transport.
Detailed evidence is available in the build and runtime comparison and the single-thread follow-up.