Utilize PGO for windows x64 rustc dist builds by lqd · Pull Request #96978 · rust-lang/rust (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation169 Commits4 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

lqd

Member

@lqd lqd commented

May 12, 2022

• Loading

cristaloleg, janroudaut, jk-gan, duyet, bernaferrari, lumenian, mominul, Paulo-21, Kobzol, CYBAI, and briansmith reacted with heart emoji Kobzol, michaelwoerister, wesleywiser, Noratrieb, rgwood, ptondereau, FilipAndersson245, PersonBelowRocks, Nerixyz, zohnannor, and 29 more reacted with rocket emoji

@lqd

@bors

⌛ Trying commit de0a53ad00db52cc21c031b27202fe312896c25e with merge 36167224f1306544c5a9c050ef151c0e6d81b745...

@bors

@bors bors added the S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

label

May 12, 2022

@rust-log-analyzer

This comment has been minimized.

@lqd

@bors

⌛ Trying commit e006ba81940512f2f255b32594e34197c022d8ea with merge 57b5bac113c6e1100592c1bf7d5a7fc61d74e332...

@rust-log-analyzer

This comment has been minimized.

@bors

@lqd

@bors

⌛ Trying commit 588de49ce861165222eb39ce14942ea158bef945 with merge 031d87645f5dacc484cc4590a1aa9abc7409a80e...

@bors

@rust-log-analyzer

This comment has been minimized.

@lqd

@bors

⌛ Trying commit 721a71042f995816fad00e609f727c5f710895e1 with merge 083263b570c1aa26f2f148f0e329beb40695f37e...

@rust-log-analyzer

This comment has been minimized.

@bors

@lqd

@bors

⌛ Trying commit 532f6e1803caa381874b41893a70142b662ce399 with merge e695e58c53b8f4126b9e0d7cf3f060a9e6fd8fac...

@bors

@rust-log-analyzer

This comment has been minimized.

@lqd

@bors

⌛ Trying commit 95a6d33169202e3185e9155474c7afa7a371d1f7 with merge 2e3c4fb4d1c201ad85cf7cad3e5ff0ab57635b53...

@lqd

The version 14.0.2 we currently use is busted on windows at the very least.

@lqd

When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in, causing undefined reference errors at link-time.

We do that manually, by adding clang's resource library folder to the library search path:

@lqd

This extracts the linux-isms into variables, so that the script can be extended to do PGO on windows. These variables will be overriden in a few spots, in windows-specific blocks.

@lqd

This adds windows-specific behavior into the PGO script, and enables it on CI.

@lqd

I've added the comment about disk space and reworked the commit history as requested, and will wait for PR CI to be green.

@lqd

let's see how it goes :)

@bors r=Mark-Simulacrum rollup=never

@bors

📌 Commit 9027f82 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jul 11, 2022

@Kobzol

Great work @lqd! I think that it would be nice to let people know about this. Maybe a Rust/Rust inside blog post or a reddit post? I can draft up the latter.

Edit: created a Reddit post.

@bors

@bors

This was referenced

Jul 12, 2022

@wesleywiser

@wesleywiser wesleywiser added the relnotes

Marks issues that should be documented in the release notes of the next release.

label

Jul 12, 2022

@rust-timer

Finished benchmarking commit (8a33254): comparison url.

Instruction count

mean1 max count2
Regressions 😿 (primary) N/A N/A 0
Regressions 😿 (secondary) 1.5% 1.6% 6
Improvements 🎉 (primary) N/A N/A 0
Improvements 🎉 (secondary) N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results

mean1 max count2
Regressions 😿 (primary) N/A N/A 0
Regressions 😿 (secondary) 3.2% 3.2% 1
Improvements 🎉 (primary) N/A N/A 0
Improvements 🎉 (secondary) N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Cycles

Results

mean1 max count2
Regressions 😿 (primary) 2.6% 2.8% 2
Regressions 😿 (secondary) N/A N/A 0
Improvements 🎉 (primary) -3.4% -3.4% 1
Improvements 🎉 (secondary) -5.3% -8.3% 2
All 😿🎉 (primary) 0.6% -3.4% 3

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change ↩2 ↩3
  2. number of relevant changes ↩2 ↩3

@lqd lqd deleted the win_pgo2 branch

July 12, 2022 03:47

@lqd

I think ctfe-stress-5 has been noisy recently (possibly #96267 but this time this benchmark feels jumpy at +/- 1.6%) and is probably unrelated.

I’ll re-check the CI artifacts with cachegrind to make sure it’s indeed similar to #97841 (comment) and try to find the inverse perf win in another PR, much like happened in this other PR’s try build for example.

@lqd

@wesleywiser I don't think we've announced linux PGO on the Inside Rust blog when it landed (we did for mw's initial explorations), but I'm happy to draft something if we want one. Relnotes may be the expected, or better, venue ?

@Kobzol if you want to do a reddit post, that would be sweet. But if we want an Inside Rust post, I'll ping you on zulip and we can collaborate on that.

@wesleywiser

I think it would be totally appropriate to write an Inside Rust post on this work if you're up for it 🙂

I'd be happy to review and r+ it!

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Oct 11, 2022

@he32

Pkgsrc changes:

Upstream changes:

Version 1.64.0 (2022-09-22)

Language

Compiler

Libraries

Stabilized APIs

These types were previously stable in std::ffi, but are now also available in core and alloc:

These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:

These APIs are now usable in const contexts:

Cargo

Misc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Nov 16, 2022

@he32

Pkgsrc changes:

Upstream changes:

Version 1.64.0 (2022-09-22)

Language

Compiler

Libraries

Stabilized APIs

These types were previously stable in std::ffi, but are now also available in core and alloc:

These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:

These APIs are now usable in const contexts:

Cargo

Misc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

Labels

merged-by-bors

This PR was explicitly merged by bors.

relnotes

Marks issues that should be documented in the release notes of the next release.

relnotes-perf

Performance improvements that should be mentioned in the release notes.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.