Post

Why is it that Windows is consistently slower than Linux at building software *for* Windows? I've got real numbers from CI builds of RDM Windows (.NET) on Windows and Linux runners as proof: Windows has a 1.33x median penalty. It's not a one-off, I re-ran the benchmarks 5 times

Microsoft doesn't seem to be doing much cross-compilation internally, so they'd be myopic to the problem. It's something I've observed over the past decade that I came to accept as a fact: in a CI matrix build job, Windows builds always finish last behind macOS and Linux.

0 reposts0 likes

I've heard various theories, but nothing "scientific": disk I/O, the cost of case insensitive filesystems, overhead of launching processes, you name it. At the end of the day, if you build exactly the same software targeting Windows from both Windows and Linux runners, Linux wins

I'm a Microsoft MVP and I use Windows daily, but my biggest wish is that Microsoft makes it easier to cross-compile *to* Windows. Why would the OS used to build Windows software matter, especially in CI, if it leads to the elimination of this 1.33x Windows penalty that's real?

Last time I checked. On first execution, windows and Linux behave almost the same. But, the second time, windows will behave roughly the same while Linux will run the command waaaaay faster.

For me, that's the filesystem cache. Do a test on a dual boot machine 2 times: grep something_that_does_not_exists /mnt/c/Users ... on a NTFS filesystem on both linux and windows (same hw)

Reason is linux uses by default all memory for fa cache. Guess what, compilers mostly spend their time reading all the time the same files (very true for C and .h files for instance). With non-SSD drives, years ago, compilation was way faster on the same hw on Linux compared to windows (win7/8 era)