Live data from Hacker News

How Rust 1.64 became faster on Windows

tomaszs2.medium.com

11–20 of 80 posts

Re: How Rust 1.64 became faster on Windows

#11
post #7

TLDR: Profile guided optimization was not supported on windows. That has been enabled now. So this only helps you if you are compiling on windows and want to go the extra mile of running PGO builds.

They're shipping PGO builds of the Rust compiler, so for faster compilation you don't have to do anything ("Windows builds now use profile-guided optimization, providing 10-20% improvements to compiler performance", per Rust's release notes: https://github.com/rust-lang/rust/blob/master/RELEASES.md).

Re: How Rust 1.64 became faster on Windows

#12
post #7

TLDR: Profile guided optimization was not supported on windows. That has been enabled now. So this only helps you if you are compiling on windows and want to go the extra mile of running PGO builds.

After enabling PGO, that was used to compile `rustc` itself.

So compiling Rust code on Windows is faster with 1.64 than 1.63.

Re: How Rust 1.64 became faster on Windows

#13
post #4
post #3

Earlier quoted context omitted.

I think your comments are being suppressed, they're all removed after you post. You might check on that.

https://news.ycombinator.com/newsfaq.html Look at the [dead] section

A single flagged comment and we've declared someone irredeemable. Amazing.

https://news.ycombinator.com/item?id=31738035

Re: How Rust 1.64 became faster on Windows

#14
post #5

Great to see how huge the benefit of profile-guided optimization is. I feel it's one of the more underappreciated techniques. Rust adding support for it on windows, and showcasing what a big improvement it makes on the compiler is pretty big (in addition to just having a faster compiler)

I did pgo builds for the D compiler, was about 10% to 30% even on some benchmarks.

The subtle win is the space savings, no more Jackson pollock inlining

Re: How Rust 1.64 became faster on Windows

#15
post #8
post #6

What is the common consensus on benchmarking test suites in Rust? From what I understood: Criterion was the gold standard, but there is a built-in benchmark suite but that is only supported in Nightly. What’s the difference?

Criterion is still the gold standard. Pros for Criterion over the stdlib: https://github.com/bheisler/criterion.rs#features Downsides of Criterion: https://bheisler.github.io/criterion.rs/book/user_guide/know...

Thanks throwup!

Re: How Rust 1.64 became faster on Windows

#16
post #13
post #4

Earlier quoted context omitted.

https://news.ycombinator.com/newsfaq.html Look at the [dead] section

A single flagged comment and we've declared someone irredeemable. Amazing. https://news.ycombinator.com/item?id=31738035

Look closer.

Re: How Rust 1.64 became faster on Windows

#17
post #13
post #4

Earlier quoted context omitted.

https://news.ycombinator.com/newsfaq.html Look at the [dead] section

A single flagged comment and we've declared someone irredeemable. Amazing. https://news.ycombinator.com/item?id=31738035

I dont think that's right, because there are 6 non-dead comments after that one. But very new accounts are likely to be banned after a single flag, to avoid ban evasion.

Re: How Rust 1.64 became faster on Windows

#18
post #10

I thought PGO instrumentation works on basic blocks, and the inlining, outlining, and register allocation optimisations are all done on llvm’s IR. So everything can happen in the backend. What sort of work is OS specific, or language specific? I’ve used PGO before, but I’m not familiar with the details.

Computing the profile wasn’t possible on Windows

FTA: But there is one problem: PGO was up until now available only on Linux.

I think they couldn’t use a profile generated on Linux because of differences in ABI and standard library.

I also think generating a profile is OS dependent because you want it to not have much of a performance impact.

Post reply on HN