Speed up NetBeans projects on Mac OS X
By ritzmann on Jan 14, 2009
The following is not really specific to NetBeans or NetBeans projects. You can speed up almost any application that relies on many file operations this way. A nice side effect is that not only NetBeans builds but also NetBeans itself works much faster that way, i.e. file scans and other operations in the IDE that used to take a longer time, are almost instantanious after the change.
The easiest way to use the Mac OS RAM disk is through this donationware utility: Espérance DV. If you really like the command line, you can achieve the same with the help of the hdid service that is built into Mac OS.
No matter how you do it, create a RAM disk, copy your project into it and point NetBeans to it. That's it. In my case, for a large project with lots of file operations during the build, unzipping archives, copying around lots of files, etc. my build finished five times faster than before. That's a huge deal when you run these builds all the time.
There are some drawbacks of course. It is a RAM disk after all, i.e. once the power is gone so are your files. That can be fatal when your system suddenly hangs and needs to be powercycled for example. Espérance DV has an option to save your files to a disk image and restore them from there but you need to manually initiate the saving. That is good enough I guess when you regularly reboot your system unless you forget to press the save button. It won't help however when the system freezes. I haven't tried it out but I hope that Time Machine automatically backs up the RAM disk, which would allow you to restore the content again should it be wiped out accidentally.