Enable PGO for Windows x86-64 Ruff releases - #27573
Draft
charliermarsh wants to merge 2 commits into
Draft
Conversation
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 7, 2026 20:31
0c383eb to
18cc775
Compare
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 7, 2026 20:56
18cc775 to
15b4ada
Compare
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| non-augmented-assignment | 1 | 1 | 0 | 0 | 0 |
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
Extend Ruff's existing release profile-guided optimization to native Windows x86-64 builds. The Windows release job installs the Rust toolchain's LLVM profiling utilities, trains an instrumented executable on the existing immutable Python ecosystem corpus, and supplies the merged profile to the existing maturin build.
Both instrumented and optimized builds explicitly preserve
-C target-feature=+crt-static, so the resulting executable retains the existing compatibility with machines that do not have the Microsoft Visual C++ Redistributable installed. The release job inspects the final executable's PE imports and rejects dynamic Visual C++ or Universal CRT dependencies.The changes apply only to
x86_64-pc-windows-msvc; Windows i686 and ARM64 builds retain their existing behavior. Wheel installation and standalone ZIP packaging continue to use the same optimized executable.Compared with the matching Ruff 0.16.2 non-PGO Windows release built from identical source, dependencies, and toolchain, the statically linked executable decreased from 32,525,824 bytes to 29,476,352 bytes (9.38%), the standalone ZIP decreased from 11,103,206 bytes to 10,553,559 bytes (4.95%), and the wheel decreased from 12,023,336 bytes to 11,435,941 bytes (4.89%). Both executables have zero dynamic Visual C++ or Universal CRT imports. Profile generation took 7 minutes 4 seconds, followed by a 4-minute-5-second optimized wheel build.
Stacked on #27572.