One of the major items in our development toolbelt is NetBeans for PHP. We use this for all our web development, and it fits our workflow perfectly.

Or, it did.

For the last few months Netbeans was getting slower and slower. I’d start up Netbeans, work for five minutes, and then check my CPU usage – it would always be at 100%. We even thought it was my laptop, and we made plans to replace it (only 18 months old, and I didn’t think I used it *that* hard!).

Netbeans was unusable. Once CPU hit 100%, the entire machine would slow down. As I spend over 12 hours a day developing in the week, this wasn’t a good situation to be in. I needed to find a solution.

1. I tried downgrading to Netbeans 6.8. It helped a little, but within a few days I was getting the same issues. Too slow – I even submitted some ‘Unresponsive’ bug reports to NetBeans. They were suggesting it was ‘autocomplete’.

2. I tried turning off SVN (even though that’s a major part of my workflow). No joy – still treacle-like. Same result when turning off other parts of the UI, such as auto-complete.

3. I looked at alternative PHP IDE’s; phpDesigner, Dreamweaver, PHPEdit, Zend, even (ugh!) Eclipse. They all had drawbacks of various kinds. Even with the slowness, NetBeans was still my favourite.

4. I tried upgrading to the development release of Netbeans 7.0. SUCCESS! ….actually, no. It was still slow. But… it gave me the answer.

And the solution is…

A stupid design choice by Netbeans. Let me explain…

I work for several clients at a time, plus our own projects. In Netbeans, I have these categorized as Project Groups, so all the projects for Client A are in one folder, projects for Client B in another – etc.; most projects are in Drupal, so I have all the Drupal files for a website in the folder also. Most clients have 15-20 sites in the Project Group, and I usually work on one at a time (maybe with another open for reference).

The design choice by Netbeans is that they assume that every project in a Project Group is actually open and being worked on. So in the background Netbeans is looking at thousands of files in projects that you aren’t working on, looking for syntax errors and ToDo items; clogging the machine up dreadfully. I found this via 6.10 because it set the display layout to it’s default – including the Tasks window, where I saw lots of tasks related to projects I wasn’t working on.

The solution: Abandon Project Groups. I now do my client organization on my hard drive – a folder for each client – and just open the project that I’m currently working on. Netbeans is back to it’s super snappy self, and I’m a happy developer again…

I hope this helps other people, because it held me down for several weeks. My wife didn’t have the problem – but she works on far fewer websites than I do (she goes for quality..!).