Just like Windows computers Macs tend to get slower with time. Its not a problem of the hardware loosing power but rather the filesystem getting filled up, additional services running in the background, file system fragmentation increasing …
What file fragmentation is can be quite easily understood. Think of storing a couple of documents on your harddrive. Each document occupies a little bit of space. If you delete one of those documents its space is made available again leaving a gap between the other documents. If you then copy a large file to the drive, gaps like the one of the former document are used by the filesystem to store parts of the new file. So the new file isn’t written on the disk in one piece but is scattered in (potentially) many pieces. Over time fragmentation in the file system grows and grows – especially if your drive is quite full.
Modern file systems are quite smart and try to avoid that by attempting to find a place for a file thats big enough to fit it in a whole so the file doesn’t need to be fragmented. However, as just said, that only works if there is sufficient free disk space.
It’s a faily widespread knowledge among Windows users that defragmenting the harddrive can bring back some of the lost performance compared to a new system installation. Apple on the other hand states that defragmenting a Macs disk is not necessary as the filesystem avoids most fragmentation by itself. Well, it’s not really easy to check if that claim is true because Mac OS X doesn’t ship with a defrag tool. There is however third-party software that fills the gap – like Drive Genius. As there is a lot of debating going on about the usefulness of defragmentation on Macs I thought I put Apples claim to a test and benchmark performance before and after a defragmentation session using Drive Genius’ boot dvd.
The System I used for the test is a 2009-MacBook Pro (2,53 Ghz Core 2 Duo, 4GB RAM) with a Samsung HM500JI harddrive. The Mac OS X 10.6 on the system had been in use for quite a while but had been cleaned up using tools like Onyx regularly. The OS had been configured to autologin a user. I measured the time from pressing the power button to turn the system on to the moment the dock bar appeared. To increase accuracy I performed the measurements 5 times and calculated an average.
After I had done my “before” measurement I defragmented the drive using the bootable Drive Genius DVD and afterwards rebooted the system three times before really starting measurements to allow Mac OS to do some optimization (which it obviously performs – see the results below). Before the defragmentation took place Drive Genius reported that 17% of the files on the volume were fragmented. Now let’s look at the measurements:
Before defragmentation
- boot: 37.5 secs
- boot: 34.5 secs
- boot: 34 secs
- boot: 33.8 secs
- boot: 35.4 secs
That results in an average boot time of 35 seconds.
After defragmentation
- boot: 95.8 secs (not considered in average!)
- boot: 49.7 secs (not considered in average!)
- boot: 33.7 secs (not considered in average!)
- boot: 32.6 secs
- boot: 32.5 secs
- boot: 32.8 secs
- boot: 32.1 secs
- boot: 32.0 secs
The average boot up time (last 5 measurements) after defragmenting the drive is 32.4 secs. That means system startup became 2.6 seconds faster.
Conclusion
So, is defragmenting useful?
Well, looking at the initial bootup time and the 2.6 seconds improvement the gain is 7.4%. That sounds reasonable – but seriously, nobody notices a difference of 2.6 seconds. There might be scenarios that benefit more than the simple boot process (which is highly optimized using caches) but the numbers above support Apples position.
If you already own defragmentation software for the mac it doesn’t cost you extra to defrag your drive from time to time and there definitly is a certain performance gain. But if don’t and you just happen to look at software like Drive Genius because of its defragmentation capability than you should probably spend the $99 that it costs somewhere else.