5 ms·
the only benchmark is care about is: how fast my project will compile from my experience, linux compiles my code about 5-10x faster than on windows
by Shadonototra 5y ago
the only benchmark is care about is: how fast my project will compile
from my experience, linux compiles my code about 5-10x faster than on windows
- neogodless 5y agoThat's incredible! Can you give us some more details outlining how you made the comparison, including what hardware, and what kind of code you were compiling?
- vadfa 5y agoIt's not incredible. Many operations such as creating a new process and accessing a file, which are done thousands or millions of times when you compile an application, are much, much slower on Windows than on Linux. That time adds up.
- marcodiego 5y ago> That's incredible! That is not incredible. I've seen windows machines take minutes to compile project from arduino-ide that compiled in a few seconds on same class machines on linux with a few students. I think it has to do with windows defender. It probably has to check binaries which are created or executed. I saw a student got a good improvement in compile times after disabling it. I didn't measure it, but I can say it was significant.
- ho_schi 5y agoLinux is a pleasure to use with the terminal and your favorite UI. GCC, Neovim or whatever you use are easily usable. And yes - it is always compiling faster. But I would say, honestly twice as fast ;) In real world scenarios Windows will be probably even slower, to to installed secondary and tertiary Antivirus and bloatware on top and unmaintained drivers. While on Linux you better choose your hardware wisely before buying, than it will run smooth. Intel and AMD are always fine.
- FrrFrr 5y agoYeah this lines up. Anything storage related on Windows is an order of magnitude slower. The way Linux has architected NVMe storage IO path vs Windows makes a huge difference. Just too many layers of abstraction for the storage stack on Windows. It worked great when we had spinning HDDs and IO was much much slower than memory. Now with super fast IO all those layers are creating bottlenecks. You’ll get faster speeds on Windows with WSL + ext3/4 than native Win + NTFS.
- jart 5y agoThis. I maintain a project that has to build about 28,000 object files. It takes less than a minute on Linux. Even though our binaries run on Windows, we willfully choose not to support building them on Windows. I tell people, trust me, it'll compile so much faster if you just create a Linux VM on your Windows computer and then run make there. But they never believe me until they see it with their own eyes. vfork() is a thing. It also helps to not have to fsync() on close() due to shortcomings with win32.
- phendrenad2 5y agoWhy are you compiling on your local machine? Do you live in a remote village without high-speed internet?
- jart 5y agoAm I supposed to be writing my code in the cloud?
- phendrenad2 5y agoUploading a diff, compiling, and downloading the resulting artifact is usually extremely fast on modern internet connections.
- supercheetah 5y agoWhat about cross compiling Windows binaries from Linux with MinGW or the like?
- jart 5y agoI use something better than MinGW which lets the Linux binaries I build, run not only on Windows, but also Apple, FreeBSD, NetBSD, OpenBSD, and boot from BIOS too. It's sort of like what Java promised to be with the whole saying, "build once run anywhere" except it actually is and it doesn't need an interpreter either.
- dataflow 5y ago> from my experience, linux compiles my code about 5-10x faster than on windows If this is C++, you must be running GCC? And I'm guessing it might not be the MinGW version? Try Clang. Something GCC does makes its performance die on Windows. Not entirely sure what it is but you won't see this kind of a difference with Clang (or I think the MinGW version of GCC). Well either that, or you're compiling a language that's so fast to compile that most of the time is spent just opening and closing files.