Any tips for speeding up compilation on windows machine on GitHub actions?

In rust-analyzer, compile time on windows in CI is measurably slower than on ubuntu or mac:

Are there any tips on how to improve this? I wouldn't expect compilation to be particularly IO-heavy, so I am a bit surprised to see the difference here. Or are they just using different machine specks for ubuntu and windows?

1 Like

I can only see that build time on Ubuntu and Windows not different much: 4m 13s vs 6m 27s.

That's like 50% longer, feels like a pretty big difference to me :slight_smile: I am specifically interested in the Compile step difference, which is 3:40 vs 2:43 and explains half of the difference (the other half seems to be initial checkout/caches, which is mostly IO and is unsurprising to me).

The crate may have more deps on Windows than Linux
(for example winapi).
Also, it is a known issue that rustc generated programs
slower on Windows than on Linux. The issue is tracked on
rust-lang/rust but I couldn't find it now.

1 Like

Is this not just a result of that launching processes on Windows is spectacularly slow? How many processes are launched during the build?

There are 30 crates being compiled. This should mean like 35 processes launched while compiling. Even if process launching takes 1s (which it isn't) that wouldn't explain the slowness.