Thoughts on Fragmentation

I know that I've mentioned this before but...

I've always thought that defragmenting your hard disk to be unnecessary if you're working primarily with audio files. Due to the large and typically fixed size of most audio files and a minimum of deletion, fragmentation should not really become a problem.

"Fragmentation" occurs when a file is written to multiple locations on the hard drive. This is an unavoidable problem, since the only alternative is to relocate all of the files relative to file to be written. Let's say (warning: generalizing)that you save 10 100k Word documents on a DEfragmented disk, one right after the other such that they are all written consecutively to the disk. Now delete the fifth file. What happens? Does the OS move all 4 of the files that occur after the deleted file "down" to fill in the gap? Of course not, you're simply left with a 100k (let's not get technical) hole. Now let's say that you write a new 200k file. What happens? 100k of this file will be written into the hole, and the remaining 100k will be written to the next available space. Therefore the file has become fragmented and when you open the file, it must be read from multiple locations on the hard drive, thereby degrading performance.

But wait! We're talking about reading and writing multiple large files concurrently. Therefore, quite a bit of fragmentation is possible and that's bad, right? Well, not really.

Think about what happens when you're working with multiple audio files in your multitracking software. (this will be partially dependant on your multitracking software) Press play. Your software is going to read a snippet from track one, then a snippet from track two, then a snippet from track three, and so on and so forth. This of course happens very quickly, such that it *feels* like you're reading the files "at the same time". If each file is large, say 50MB, and each is written concurrently (no fragmentation), then your hard drive is going to have to skip at least 50MB worth of data to read the next portion of the next file, and so on.

In a perfect world, your files would be written to the disk such that a portion of the first file is written, then a portion of the second file, then the third, etc and repeat. Each portion would be equal to the maximum amount of data that the software will read. In this particular case the hard drive would be free from excessive seeking and your entire song would simply "spin off" all nice and neat. This is possible if you record all of your music at once with no overdubbing. That is, you record say, six tracks all at once. Proper software will write (as it's recording) a portion of track one, then a portion of track two, and so on, until you're left with a large mess of fragmented files. But this is a GOOD mess, and would be more appropriately termed "interleved".

I have come to the conclusion that frequently defragmenting your hard drive will actually worsen recording performance in many cases. In fact, "good" fragmentation (interleving the right files in the right order) will actual help to improve performance! Somebody should write a tool that does this for you!

Well, I just stumbled upon one, but haven't tried it out yet.
http://www.analogx.com/contents/download/audio/interlv.htm

The small description of this software brings up some pretty interesting points, and is worth a read even if you don't use the software.

Slackmaster 2000
 
Any program meant to optimize the placement of clusters on a HD has to take into account the physical addressing layout on the HD actually being used. I don't believe one size fits all here.
I remember someone posted a really nifty solution to the Defrag or not to Defrag issue. Keep a separate partition for audio files and when you're done recording and editing a project, write it to CDR and reformat the partition. Bam! Instant defrag.
No waiting.
 
Back
Top