Live data from Hacker News

Why is Windows so slow?

games.greggman.com

111–120 of 159 posts

Re: Why is Windows so slow?

#111
post #24

Earlier quoted context omitted.

Maybe I'm misunderstanding (or he's since changed his post), but: dir /s > c:\list.txt is piping it into a file. Where does the speed of the terminal affect that (in any significant fashion)? I know what you're getting at - tar --verbose can slow things down for me by sometimes a factor of 2 (for huge tarballs), but I don't think it's an issue in this situation.

Yes, I saw the redirection. But "dir" is an built-in command in the Windows shell; is the speed of that command a benchmark-able number? Is the point to compare the speed of "ls" vs "dir", or the underlying OS/file-systems (i.e., posix vs. win32 /Ext3 vs. NTFS)? If someone tells me that "dir" is slow, I'd agree -- but that -- in itself -- doesn't imply that the filesystem is slow.

If it's unreasonable to assume a 30-year old command extending directly back to MS-DOS 1.0 has never had anybody once take a look at making sure it isn't unreasonably slow, well, I think there's some reasonable conclusions we can draw from that with regards to performance on Microsoft products.

Re: Why is Windows so slow?

#112

Earlier quoted context omitted.

Please show me something to back this nonsense up.

How about you back up calling it nonsense?

With respect, this is not how claims work. You can't make a claim and then expect your opponents to have the burden of proof to refute it.

If you make a claim such as 'GCC produces significantly worse code than alternate compiler A' then it's completely reasonable to ask for something to support it. Tone wise perhaps the post could have been improved, but the principle stands.

Re: Why is Windows so slow?

#113
I'm disappointed HN! There is a lot of pontificating, but not much science here.

It takes all of 2 minutes to try this experiment yourself (plus ~8 minutes for the download).

1. Download chromium http://chromium-browser-source.commondatastorage.googleapis....

2. Unzip to a directory

3. Create this batch file in the src directory, I called mine "test.bat"

    echo start: %time% >> timing.txt
    dir /s > list.txt
    echo end: %time% >> timing
4. Run test.bat from a command prompt, twice.

Paste your output in this thread. Here is mine:

    start: 12:00:41.30 
    end: 12:00:41.94 
    start: 12:00:50.66 
    end: 12:00:51.31 
    
First pass: 640ms; Second pass: 650ms

I can't replicate the OP's claim of 40000ms directory seek, even though I have WORSE hardware. Would be interested in other people's results. Like I said, it only takes 2 minutes.

Re: Why is Windows so slow?

#114
post #59

Earlier quoted context omitted.

Unfortunately most of the drivers are in the long tail of unpopular devices. This results in greatly reducing the average number of eyes per driver. This has a double effect: there are less developers who can attempt to fix problems with a driver and second, the incentive seems smaller - make general I/O 0.5% faster and you're a hero of the public, fix a critical problem in an unpopular device driver and maybe 1 pers…

Exactly. I'm afraid this isn't a solvable problem. Device makers must be responsible for device drivers, open source or not.

Generally, they are. They get their Windows compatibility certification and everything.

Oh, wait, you mean for Linux? Good luck with that. The sad thing is that either providing drivers for Linux or providing detailed enough specs that drivers can be written by the OSS community offers little for no payback for the effort. As a Linux user, I feel lucky that any hardware manufacturers even acknowledge people might be running something other than Microsoft.

When you're in bed with Microsoft, you probably have even more reasons to blow off the OSS community. The sweaty chair-chucker wouldn't like it, and you don't want to get him angry. You wouldn't like him when he's angry.

Re: Why is Windows so slow?

#115

I'm disappointed HN! There is a lot of pontificating, but not much science here. It takes all of 2 minutes to try this experiment yourself (plus ~8 minutes for the download). 1. Download chromium http://chromium-browser-source.commondatastorage.googleapis.... 2. Unzip to a directory 3. Create this batch file in the src directory, I called mine "test.bat" echo start: %time% >> timing.txt dir /s > list.txt echo end: %t…

Unfortunate that this comment doesn't get enough attention in this thread... A single person's experience will always be subjective (even with the provided technical detail). If it's not consistently repeatable, it can only be used as an anectode.

Re: Why is Windows so slow?

#116
post #45

Earlier quoted context omitted.

Along the same line, I've never understood Windows' propensity to swap out the kernel. I might have tons of free memory and half my kernel is swapped out. In fact, I've never figured out how to get it not swapped out, no matter how much memory I put in.

You could try this (from an elevated command-prompt), but the general consensus is that it has a small (if any) effect: reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive -d 0x0 -t REG_DWORD -f Disable it with: reg add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive -d 0x1 -t REG_DWORD -f More discussion here:…

Since we're talking about optimization, if you're on a SSD you should disable prefetching--which is essentially a technique for older (read: shittier) computers.

Re: Why is Windows so slow?

#117
I'm pretty sure the "dir" takes longer than "ls" because "dir /s c:\list.txt" sorts the entire c:\ drive before looking for "list.txt". "ls -R c:\list.txt" first checks if "list.txt" exists, and fails if it doesn't. Just take out the "list.txt" and run both commands again.

Re: Why is Windows so slow?

#118

Don't forget forking. To benchmark the maximum shell script performance (in terms of calls to other tools per second), try this micro-benchmark: while true; do date; done | uniq -c Unix shells under Windows (with cygwin, etc.) run about 25 times slower than OS X.

Well, Unix shells under Windows don't even implement forking, so this test is kinda meaningless isn't it?

It's like racing cars where one of the cars has its wheels taken off.

Re: Why is Windows so slow?

#119

I'm disappointed HN! There is a lot of pontificating, but not much science here. It takes all of 2 minutes to try this experiment yourself (plus ~8 minutes for the download). 1. Download chromium http://chromium-browser-source.commondatastorage.googleapis.... 2. Unzip to a directory 3. Create this batch file in the src directory, I called mine "test.bat" echo start: %time% >> timing.txt dir /s > list.txt echo end: %t…

Wow, you are awesome for posting facts! I have often wondered if it was some systemic thing about the centrally-managed setups of Windows at Google that was making the Chrome build suck so much (such as some aggressive antivirus, as people often suggest in these situations). My recollection is that people run into the same slow build problems on non-Google-owned Windows computers, but perhaps that "slow" is a different slow than the OP's problem.

(For comparison, I have an older checkout on this Linux laptop. It's around 145ms to list, and it's 123k files. The original post mentions 350k files, which is a significantly different number. It makes me wonder if he's got something else busted, like "git gc" turned off, creating lots of git objects in the same directory producing some O(n^2) directory listing problem. But it could just as well be something like build outputs from multiple configurations.)

Re: Why is Windows so slow?

#120
What I can't wrap my head around is the amazingly slow file search (I'm using Vista). Searching for a filename I know exists in a small directory (say, 100 files) often leads to Windows searching for several minutes and then NOT FINDING THE FILE. How can that happen when Windows is able to list the contents of the directory (including the file I'm looking for) instantly?
Post reply on HN