Customising Netbeans for better performance and ease of use as a PHP IDE
25 Aug 2011For all my day to day development work, be it in php, html, js and even when I branch out into Java or C/C++, I use Netbeans as my IDE of choice. I first got into it when coding Java at university but since then I’ve moved into mainly working on PHP web apps and it has proved to be, in my opinion, the best PHP IDE available. In this post I’m going to highlight a couple of customisations I’ve made to make it’s use easier.
For the past couple of years I’ve used Netbeans on Ubuntu, previously I used Visual Studio on Windows but then I was developing C++ Applications. When I moved to Ubuntu I looked for a new IDE to patronise, I’ve never really got on with VIM or emacs.
Performance
Recently I’ve upgraded my main machine and it now has 16GB of RAM but netbeans was still sluggish, after reading around I found its memory parameters can be tweaked in config files. It should be noted that netbeans does attempt to auto tune itself on start-up for the amount of system memory but in my opinion it doesn’t do a great job. After much experimenting and breaking I came up with the following modification which seemed to make the whole system much more snappy:
The changes are made in the main netbeans config file, in Netbeans 7 that is:
Then change the default launch command line from:
to
This change increases the amounts of memory available to netbeans on startup and thus things get much more responsive. The later parameters also try to improve font rendering.
This configuration could probably be tweaked more if I properly understood what I was doing but after breaking it I was just satisfied with a significant speed increase.
Formatting
I find the default font settings in netbeans too white, harsh on the eyes and also too bit so I’ve scaled down the font and added the solarized theme.
That changes the look from this:
Into this:
If you’re lazy you can download my preferences file here and install it in Tools>Options>Import
Other Stuff
- I always modify the formatting so that it reflects the set of coding standards I have in my head and I can use auto formatting.
- I setup Xdebug for PHP debugging and profiling