HFS+ also has a few specific optimizations. When a file is opened on an HFS+ volume, the following conditions are tested:
— The file is less than 20 MB in size
— The file is not already busy
— The file is not read only
— The file is fragmented (the eighth extent descriptor in its extend record has a non-zero block count)
— The system uptime is at least 3 minutes
If all the above are satisfied, the file is relocated (de-fragmented) - on-the-fly.
What Is Mac OS X?, Mac OS X Filesystems (Amit Singh)