←back to thread

Why is Windows so slow?

(games.greggman.com)
337 points kristianp | 8 comments | | HN request time: 0.513s | source | bottom
Show context
niyazpk ◴[] No.3368875[source]
Here is a link from the comments:

NTFS Performance Hacks - http://oreilly.com/pub/a/windows/2005/02/08/NTFS_Hacks.html

replies(1): >>3368934 #
1. yread ◴[] No.3368934[source]
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 drives and will allow files to open slightly faster.

is wrong. When you increase cluster size you will definitely not "reduce the amount of space you are wasting". 100B file will still occupy the whole 16KB ( so you will waste 15.9KB on it instead of 3.9KB with 4KB clusters.

Also I would be very careful with taking advice like that from an article which is 6 years old (before introduction of Win7 or XP SP3!)

replies(3): >>3369053 #>>3369075 #>>3369219 #
2. maaku ◴[] No.3369053[source]
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.
replies(2): >>3369216 #>>3369548 #
3. biot ◴[] No.3369075[source]
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.
replies(1): >>3369434 #
4. muyuu ◴[] No.3369216[source]
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.
5. rbanffy ◴[] No.3369219[source]
I haven't used Windows as my primary OS for almost a decade and haven't even booted it on bare metal for the past couple years, so my guesses must be taken with a grain of salt. I always found directory fragmentation (much more than file fragmentation) to be a huge performance problem on Windows. If increasing cluster size effectively reduces directory fragmentation, your life under Windows will be much better.
6. yread ◴[] No.3369434[source]
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...

replies(1): >>3376130 #
7. tobias3 ◴[] No.3369548[source]
NTFS uses run lists (comparable to extends in ext4) so you would only have more metadata if your drive gets fragmented. (Which I hope for the sake of comparability is not the case here)
8. biot ◴[] No.3376130{3}[source]

  "But if your files are generally much larger or tend to grow over time..."
No numbers are given in what you quoted, but when I think about "much larger" I'm thinking of file sizes in the megabyte to gigabyte range, such as a dedicated data drive for a media server or a database server. A 4KB median file size doesn't fit my mental model of "much larger".