Live data from Hacker News

Why is Windows so slow?

games.greggman.com

61–70 of 159 posts

Re: Why is Windows so slow?

#61

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.

Re: Why is Windows so slow?

#62
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 comparable 5 minutes for Windows, 4 minutes 35 on Linux.

Release build time is almost 7 minutes on Windows and half that on Linux.

VS compiles more slowly than gcc but overall it's a better compiler. It handles static variables better and is not super demanding about typenames like gcc is. Also gcc is extremely demanding in terms of memory. gcc is a 64-bit executable, Visual Studio is still a 32-bit execuable. We hope Microsoft will fix that in Visual Studio 2011.

Its easier to parallelize gmake than Visual Studio, which also explains the better Linux build time. Visual Studio has got some weird "double level" mulithreading which is eventually less efficient than just running the make steps in parallel as you go through your make file.

However our tests run at comparable speed on Linux and Windows and the Windows builds the archive ten times faster than Linux.

Re: Why is Windows so slow?

#63
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.

For all you know you're seeing the HDD cache and not any kind of filesystem caching. evmar mentions SSD making a difference for workloads that should fit in RAM, which means HDD caching also would, for a very modest workload.

Re: Why is Windows so slow?

#64
post #10

I don't know this poster, but I am pretty familiar with the problem he's encountering, as I am the person most responsible for the Chrome build for Linux. I (and others) have put a lot of effort into making the Linux Chrome build fast. Some examples are multiple new implementations of the build system ( http://neugierig.org/software/chromium/notes/2011/02/ninja.h... ), experimentation with the gold linker (e.g. measu…

Perhaps the difference is that when people write awesome tools for Windows or Mac they try to sell them rather than give them away.

Well, if that was true, then you could just buy the better tool and use it, right? I suspect they don't exist because

a) On Linux, you have the existing linker to build your better one on. On Windows, you'd have to write your own from scratch making it less appealing for anyone (only people who'd buy it were those running huge projects like Chrome)

b) What you said about the file system itself just being plain slow.

PS: (Long time follower of evan_tech - nice to see you popup around here :) )

Re: Why is Windows so slow?

#65

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…

What is this archive step you mention in passing, and what makes Linux slow at it?

Re: Why is Windows so slow?

#66
post #65

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…

What is this archive step you mention in passing, and what makes Linux slow at it?

I don't know why Linux is so slow at it, it's when we build the tgz containing all the binaries before uploading it to the distribution server.

Re: Why is Windows so slow?

#67

Wow, so if you want to test file system speeds, you do it by listing files - I know this just an example, but perhaps it has something to do with the speed of the terminal ? There are a plethora of disk benchmarking tools - I doubt that they consistently show 40x differences. Hooves -> horses, and all that.

Huh? He redirected the output to a file, so terminal speed doesn't really factor in here.

It might be, actually, since dir is a command built into cmd.exe on Windows, not a separate .exe that gets run. It may be smarter to use "ls" from cygwin for the test.

Re: Why is Windows so slow?

#68
post #12

Earlier quoted context omitted.

Why should he run the ls command on ntfs rather then a native file system? In all it was a "windows vs linux" test and not a fileystem test. Testing the same filesystem wouldn't make sense here

Presumably to find out whether the difference lies with the filesystem or somewhere else? If Linux is still much faster, even with the same filesystem, you have eliminated one variable.

But then you'd be comparing NTFS implementations. The codebases are completely diffrent.

Re: Why is Windows so slow?

#69
post #41
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…

That's not the point he's trying to make. Smaller cluster sizes leads to larger amounts of file-system metadata keeping track of where those clusters are laid out on disk, as well as the overhead of generating, accessing, and updating those data structures.

If files are typically bigger than 16KB, 16KB clusters can potentially save space vs 4KB clusters, by needing smaller cluster indices. Not sure if that's the case for NTFS though.

Re: Why is Windows so slow?

#70
post #65

Earlier quoted context omitted.

What is this archive step you mention in passing, and what makes Linux slow at it?

I don't know why Linux is so slow at it, it's when we build the tgz containing all the binaries before uploading it to the distribution server.

Possibly Linux isn't using the same compression settings?
Post reply on HN