The equivalent linux question reminded me of the bad performance of my MacBookPro. I'm not even sure what the default FS nowadays is. I read somewhere that there is a cron job which runs on friday or saturday which does such stuff.
So do I need to defrag my disk? And if, How would I do that?
With the default file system JHFS+ or Mac OS Extended (journaled), recent versions of Mac OS X defragment some things automatically. However, if you use large files or have a very full disk you may benefit from defragmenting.
If large amounts of contiguous space are occupied by multiple swapfiles at
/private/var/vm
then restarting the System can temporarily free the space used by all but one of those files, and so possibly allow other types of file to be written — without fragmentation — in that space.See "About disk optimization with Mac OS X"
iDefrag is one product listed in Apple database that also states it doesn't touch the "Hot Zone" which is an area of the disk used by OS X to optimize disk access. They have a demo version you could try.
Adding to Glenn's answer, Amit Singh has done thorough testing and written a tool
hfsdebug
. In his results, he concludes: