Live data from Hacker News

How Rust 1.64 became faster on Windows

tomaszs2.medium.com

71–80 of 80 posts

Re: How Rust 1.64 became faster on Windows

#71
post #38

Earlier quoted context omitted.

Unfortunately, many projects never benefit from PGO, because there is quite a lot of complexity involved in setting up a profiling workload, storing the profile somewhere, and using it for future builds. I'd like compiler writers to embed a 'default profile' into the compiler, which uses data from as much opensource code as they can find all over github etc. This default profile will improve the performance of lots o…

JITs do PGO all the time. It’s their bread and butter.

Nowadays they also save PGO across executions, so that they don't always start from zero.

The most modern ones that is (Java, .NET, Android).

Re: How Rust 1.64 became faster on Windows

#73

Earlier quoted context omitted.

Unfortunately, many projects never benefit from PGO, because there is quite a lot of complexity involved in setting up a profiling workload, storing the profile somewhere, and using it for future builds. I'd like compiler writers to embed a 'default profile' into the compiler, which uses data from as much opensource code as they can find all over github etc. This default profile will improve the performance of lots o…

The "default" profile "for PGO" is the compiler on its own -- folk put a lot of effort into making sure it will generally compile arbitrary code well. And a big part of that is lots of people running lots of open source code and measuring how well it performs. The difficulty with "as much open source code as they can find" is that we need to execute the code to make a profile. And unless we're running the code under…

To that point, llvm now has an "ml inliner" that's been trained on a lot of open source code to allow it to make the best inlining decisions.

Re: How Rust 1.64 became faster on Windows

#74
post #62
post #61

Earlier quoted context omitted.

Meh, I remember the move from DOS 3.3 to ProDOS back in the Apple //e days and the loss of spaces in filenames was something that seemed a regression to me.

I’d rather see a ban on non-Unicode strings as file paths. ^&*# Windows.

each time a new unicode version is introduced, you get new backward compatibility issues

Re: How Rust 1.64 became faster on Windows

#75
post #71
post #38

Earlier quoted context omitted.

JITs do PGO all the time. It’s their bread and butter.

Nowadays they also save PGO across executions, so that they don't always start from zero. The most modern ones that is (Java, .NET, Android).

I don’t know if V8 does between runs but it seems to share something between subprocesses. There is commentary in the Node Worker docs about turning it off/on.

Re: How Rust 1.64 became faster on Windows

#76
post #74
post #62

Earlier quoted context omitted.

I’d rather see a ban on non-Unicode strings as file paths. ^&*# Windows.

each time a new unicode version is introduced, you get new backward compatibility issues

In fact, no. Unicode is rigorously backwards compatible. When Unicode 15.0.0 was released this year, the only thing I needed to do with my Unicode library was update the data tables that indicated the categories and combining classes for the newly added characters. Once a character is added, it’s there forever. This is part of why, for example, languages written in different descendants of the Brahmic script treat vowels differently, because they meant to preserve round-trip compatibility with pre-Unicode character conventions so in Thai, most vowels are treated as separate graphemes from the consonant to which they’re attached while in Devanagari, the corresponding vowels are treated as combining (and spacing) diacritics. The one place where Unicode chose to break backwards compatibility with pre-Unicode was its most controversial choice, Han unification, where the various incompatible 16-bit character encodings of Han characters (Japanese, Korean, and THREE Chinese encodings) were replaced with a single unified set that eliminated the duplications between the three sets. But within the Unicode history, I think there was one breaking change in the 90s that was fixing an error (I don’t care to dig up the history for a HN comment), but otherwise, any text encoded with a Unicode version prior to 15.0.0 will be interpreted identically in the current Unicode.

(I had someone ask for the possibility of being able to choose older versions of Unicode in my library to handle his use case with clusters in a terminal app, but on further investigation to what he was trying to do, I discovered that it was a misunderstanding about how grapheme clusters work and in fact would not do what he wanted it to do.)

Re: How Rust 1.64 became faster on Windows

#77
post #63
post #61

Earlier quoted context omitted.

Meh, I remember the move from DOS 3.3 to ProDOS back in the Apple //e days and the loss of spaces in filenames was something that seemed a regression to me.

And all this time I’ve been blaming Windows for bringing us white spaces in file names.

I think white space in file names was possible in Unix long before Windows. IIRC, VMS and (probably TOPS-10/20) did not allow white space. It may have also been possible to include spaces in DOS file names, but it’s long enough ago, that I wouldn’t be completely sure of it.

Re: How Rust 1.64 became faster on Windows

#79
post #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.

Ah, so they could probably generate an instrumented binary for Windows, but there was no infrastructure to actually collect the counts.

That would be a lot of work to set up!

Post reply on HN