rust-lang / rust-lang/rust

[opt-dist] Profile-guided optimization of LLVM regressed on Windows hosts

Open
#144,318 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-PGO C-bug O-windows O-windows-msvc T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

It has been found in https://github.com/rust-lang/rust/pull/143898#issuecomment-3068037546 that PGO build of LLVM is slower than general one a bit (~1%). Later in https://github.com/rust-lang/rust/pull/144255#issuecomment-3097557694 it has been proved that performance of MSVC dist compiler is better (the same 1%) (all in case of serde and ruff compilation). Zulip discussion has been with a question what to do with dist-msvc at the moment.
If you want to test it locally, here are the SHAs of above PR's jobs:
#144255: parent - 67819923ac8ea353aaa775303f4c3aacbf41d010; build - 978fa844ca3da87b313190c4b047f53a3cdb652f
#143898: parent - cccf075eba88363269e8589ebb8d40874cc542d8; build - a094db85f18d96658ed83010f55e8a24a68a26a0
for testing you may use rustup-toolchain-install-master tool (cargo install --git https://github.com/kennytm/rustup-toolchain-install-master), then install CI toolchains (rustup-toolchain-install-master --component=cargo <SHA> -i x86_64-pc-windows-msvc so you'll have cargo too) and then compile your favourite crate/program with hyperfine to get perf results (hyperfine "cargo +<SHA_PARENT> build --release" "cargo +<SHA_BUILD> build --release" --prepare "cargo clean" --runs 5, this will build code 5 times for each command to get a more reliable output)

please leave a cc for Windows folks and other who can help/do extra profiling, feel free to edit my message to add more info

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the performance comparisons in PRs #143898 and #144255 and the linked Zulip discussion. Reproduce the Windows MSVC results using the provided parent and build SHAs, rustup-toolchain-install-master, and hyperfine; done means identifying the cause of the regression and determining what should happen with dist-msvc PGO.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, operating-systems, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.