To Compress Or Not To Compress, That Is The Question

Read the rest of this series:

Every so often the debate arises (in tech circles) about whether or not one should use the compression feature that's built-in to Windows NTFS. One the one hand it will save you some disk space, but on the other hand it will slow down your system... or will it? (and are those the only two options?)

The argument for saving disk space is really self-explanatory.

The argument for slowing things down says that because the computer has to compress and decompress everything, it will have to use the CPU and thus it will slow down the system. This can cause a performance loss, if your CPU is already running at 100%. However, if your CPU is idle (as they are most of the time), it will use some of those cycles, but you probably won't notice the slowdown. If on a laptop, you may notice a slight drop in battery life because of more CPU usage.

That's not the whole story though. It also must be accounted for that because the data will be compressed, there will be less of it going to and from the hard disk. Just like anything else in a computer, there is a limited amount of bandwidth between the CPU and the disk. Once that is maxed-out, it becomes the bottleneck and can slow down the system. In this case, it's theoretically possible to get a performance increase, because now the data can be read from/written to the disk more quickly (because compressed data takes up less bandwidth). So if there's a lot of I/O involving compressible data (like text), could there be a benefit?

To answer this question I did some benchmarking (on Windows Vista 64bit) by testing the performance difference for compressed vs. non-compressed file systems. These tests were done using exactly the same hard disk. First I ran them on the uncompressed drive, then I enabled compression and ran the tests again.

First I used HD Tune, and here are the results:

Uncompressed drive:

Compressed drive:

This shows that the compressed drive has a slightly higher burst rate, but also a slightly higher CPU usage, but otherwise they are virtually identical.

Next I tested with Sisoft Sandra using the "File system" test. (Images have been edited to remove "reference" drives which are not relevant to this test).

The uncompressed drive:

and the compressed one:

The compressed drive had a higher throughput, faster access time, and faster reads. However there was a performance hit when it came to writing to the disk.

So there you have it, in some cases compression can be faster, and in others it can be slower. It can be faster in the case where a lot reading takes place but not a lot of writing, such as in "C:\Program Files". An area where this could cause performance problems is the user's home directory ("C:\Documents and Settings" or "C:\Users") where data files are stored and written to frequently, and anywhere that data is already compressed (such as mp3 files or video files), where it would be redundant.

Since running these tests, I have compressed all of "C:\Program Files", and wound up gaining 1.5GB of disk space (on a laptop every little bit counts). I have also noticed (though is is subjective) that programs seem to load a little bit faster than before, and otherwise have experienced no problems.

Read the rest of this series:

Great review, I am interested on this, I have used HD tune too, another free tool called hd speed, may be useful to test, it can measures both sustained and burst data transfer rates of all hard disks, features a realtime graphical display too, very small and free.

However with NTFS compression is is definitely not worth it. NTFS compression only works if it can save an entire clusters worth (or more) of space - so even though the NTFS compression algorithm may make a little difference it is highly unliklely to make enough difference with an MP3 file.

[...] So, hier hat sich einer mal der M?he unterzogen: To Compress Or Not To Compress, That Is The Question | 3 Tests, unter Win Vista 64 bit durchgef?hrt, aber nur mit einer HDD. Gerade hier m?sste der [...]