Skip to content

Enable PGO for Windows x86-64 Ruff releases - #27573

Draft
charliermarsh wants to merge 2 commits into
charlie/ruff-pgo-macos-arm64from
charlie/ruff-pgo-windows-x64
Draft

Enable PGO for Windows x86-64 Ruff releases#27573
charliermarsh wants to merge 2 commits into
charlie/ruff-pgo-macos-arm64from
charlie/ruff-pgo-windows-x64

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Aug 7, 2026

Copy link
Copy Markdown
Member

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.

@charliermarsh
charliermarsh force-pushed the charlie/ruff-pgo-windows-x64 branch from 18cc775 to 15b4ada Compare August 7, 2026 20:56
@astral-sh-bot

astral-sh-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 1 projects; 58 projects unchanged)

rotki/rotki (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ rotkehlchen/exchanges/okx.py:433:17: non-augmented-assignment Use `*=` to perform an augmented assignment directly

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
non-augmented-assignment 1 1 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant