Live data from Hacker News

Why is Windows so slow?

games.greggman.com

81–90 of 159 posts

Re: Why is Windows so slow?

#81
post #55
post #44

Earlier quoted context omitted.

What is preventing you from using MinGW? That way, you could use the GNU toolchain (Make, GCC, Binutils etc.) and still have full access to the Win32 API. You could reuse almost all of your Unix build scripts, and the rest boils usually down to making your scripts aware of different file extensions ( .exe/ .dll instead of / .so). Even better, you can do cross compiling with MinGW . So if your toolchain dosn't perform…

VC++ generates significantly better code than GCC. Enough so that performance-minded projects usually wouldn't consider MinGW/GCC for Windows code.

Does it matter during development though? You could always develop on GNU toolchain and then make a final build in VC once the feature code is complete.

Re: Why is Windows so slow?

#82
post #55
post #44

Earlier quoted context omitted.

What is preventing you from using MinGW? That way, you could use the GNU toolchain (Make, GCC, Binutils etc.) and still have full access to the Win32 API. You could reuse almost all of your Unix build scripts, and the rest boils usually down to making your scripts aware of different file extensions ( .exe/ .dll instead of / .so). Even better, you can do cross compiling with MinGW . So if your toolchain dosn't perform…

VC++ generates significantly better code than GCC. Enough so that performance-minded projects usually wouldn't consider MinGW/GCC for Windows code.

Please show me something to back this nonsense up.

Re: Why is Windows so slow?

#83
post #35
post #31

Interestingly enough Joel Spolsky mentioned something related to the directory listing problem more than 10 years ago. See: http://www.joelonsoftware.com/articles/fog0000000319.html In Joel's opinion it is an algorithm problem. He thinks that there is an O(n^2) algorithm in there somewhere causing trouble. And since one does not notice the O(n^2) unless there are hundreds of files in a directory it has not been fixed…

I don't think there's an O(n^2) algorithm in there. I just created a directory with 100,000 entries. Listing it (from Cygwin, no less, using 'time ls | wc') takes 185 milliseconds. The directory is on a plain-jane 7.2k 1TB drive, though of course it's hot in cache from having been created. 'dir > nul', mind you, is quite a bit slower, at over a second.

I think the recursive search is the thing that is broken.

Re: Why is Windows so slow?

#84
post #55

Earlier quoted context omitted.

VC++ generates significantly better code than GCC. Enough so that performance-minded projects usually wouldn't consider MinGW/GCC for Windows code.

Please show me something to back this nonsense up.

How about you back up calling it nonsense?

Re: Why is Windows so slow?

#85
post #46
post #27

Earlier quoted context omitted.

Not sure about the other things, but this The default cluster size on NTFS volumes is 4K, which is fine if your files are typically small and generally remain the same size. But if your files are generally much larger or tend to grow over time as applications modify them, try increasing the cluster size on your drives to 16K or even 32K to compensate. That will reduce the amount of space you are wasting on your drive…

How is a 100 byte file a valid refutation of what you quoted? It quite clearly states that you should leave the cluster size alone if your files are typically small.

well, OK let's take a guess at median filesize 4KB [1]. Then the 4KB cluster wastes some space only for half of the files whereas 16 KB wastes space for bigger proportion plus they waste additional 12KB for 50% of the files.

On the other hand the paper also shows how ridiculous it is to talk about the wasted space - look at figure 14, files smaller than 16KB occupy ~1% of all space. Even if we waste space 4:1 it's still ridiculously small amount of space

[1] http://www.usenix.org/events/fast11/tech/full_papers/Meyer.p...

Re: Why is Windows so slow?

#86
post #55

Earlier quoted context omitted.

VC++ generates significantly better code than GCC. Enough so that performance-minded projects usually wouldn't consider MinGW/GCC for Windows code.

Does it matter during development though? You could always develop on GNU toolchain and then make a final build in VC once the feature code is complete.

Only if you are careful to only use the subset of the C++ spec supported by both compilers and avoid all gcc specific features.

Re: Why is Windows so slow?

#87
post #86

Earlier quoted context omitted.

Does it matter during development though? You could always develop on GNU toolchain and then make a final build in VC once the feature code is complete.

Only if you are careful to only use the subset of the C++ spec supported by both compilers and avoid all gcc specific features.

I mentioned that in a context of application which is crossplatform already and when something is being developed, it affects (in most cases anyways) all platforms in the same way - so this limitation is "built-in" already.

Re: Why is Windows so slow?

#88

NTFS is a slower file system, that's probably the main reason why. Also console I/O is much better on Linux than Windows. Our software builds everyday on FreeBSD, Linux and Windows on servers that are identical. The windows build takes 14 minutes. The FreeBSD and Linux build take 10 minutes (they run at almost identical speed). Check out is more than twice slower on Windows (we use git). Debug build time is comparabl…

There's a 64-bit version of the MSVC toolchain and MSBuild, so if you build outside of Visual Studio you won't be so constrained. This is how we do our builds here at work (a mix of C# and C++). We still edit code in VS, but local builds and continuous integration are done entirely using MSBuild. As of VS2010, C++ project files are MSBuild projects, and no longer need to use VCBuild.exe.

Re: Why is Windows so slow?

#89

I'm not sure if it is related, but the fact is that file system operation on windows are much slower that on Linux. I remembering that copying large ISO image from one windows partition to another windows partition using Total Commander under Wine on Linux was faster that doing it directly on Windows. I also remember that I was able to create file copy utility in assembly as a homework assignment that was couple time…

In Total Commander you can configure the buffer sizes used while copying. Maybe in your homework you chose the right buffer size too (and, of course, asm is fast, but hard to write, I'm sure you didn't bother too much with error checking and other "small" problems). Moreover, the optimal buffer size is different for small and large files, maybe Windows is not optimized for large size like a DVD image.

As for Total commander example, that was out of the box experience, without any tweaks. I just wanted to point out that even when using emulation layer to access Windows native filesystem type, Linux was significantly faster on file system operations.

As for my homework "copy" command, I know that it is not fully replacement to file copy windows command, but if copy operations takes >10min, all those checks and additional tasks shouldn't make IO bound operation take couple time longer than what some student implemented as homework.

Re: Why is Windows so slow?

#90
post #88

NTFS is a slower file system, that's probably the main reason why. Also console I/O is much better on Linux than Windows. Our software builds everyday on FreeBSD, Linux and Windows on servers that are identical. The windows build takes 14 minutes. The FreeBSD and Linux build take 10 minutes (they run at almost identical speed). Check out is more than twice slower on Windows (we use git). Debug build time is comparabl…

There's a 64-bit version of the MSVC toolchain and MSBuild, so if you build outside of Visual Studio you won't be so constrained. This is how we do our builds here at work (a mix of C# and C++). We still edit code in VS, but local builds and continuous integration are done entirely using MSBuild. As of VS2010, C++ project files are MSBuild projects, and no longer need to use VCBuild.exe.

I didn't know about the 64-bit toolchain, where can you get it?
Post reply on HN