Yet another significant speed up the Plugins Manager
By Rechtacek's on Aug 27, 2008
As I was writing in my previous post I've continued on improving performance of Plugin Manager. After lowering memory consumption while parsing content of Update Centers I'm focusing speed of handling plugin's updates. I got feedback several times that install of the patches of NetBeans 6.1 IDE can be very slow, specially when installing a big patch into full IDE distribution. I that case IDE users have to sit by and be watching Please wait dialog for a few minutes.................... It was ugly
It was really ugly but it won't be anymore. I achieved significant acceleration of processing plugin's updates. Thanksgiving Jara now I have a testing Update Center containing updates of all plugin's installed in Development build of NetBeans IDE. With that UC I investigated and measured processing update in Plugin Manager. I found out some methods has to be called million times. Although it made sense in the applied analysis model of plugins dependencies, model computation was inacceptable due to its slowness. So, that's the right momentum to start thinking about change the model. Right, I had to do it.
The former model works over plugin-to-plugin dependencies. Starting with some visible plugin goes down to else plugins on which depending on. If some of evaluated dependencies forced to add plugin within collection of updates, the dependencies evaluation will continue on itself and so on. It worked, but some dependency evaluation can become useless. If the case P1 depends on D and P2 depends on D as well, analysis model contains dependency P1->D and P2->D, it means two evaluations.
The new model does abstraction which plugin depends on another one and just evaluates dependency itself regardless which plugin declaring that on. In the previous example, the new analysis model works with ?->D dependency only, it means only once evaluation instead of twice. Just idea but with amazing consequence, on testing Update Center is much faster from 40s on old model to 2s (!!!) on the new one. In the Big O notation words, the former model was working with O(n2) but the new model has O(n) complexity I think.
Simply, fixing performance problems can be a amazing story sometime. I'm sure this algorithm change makes Plugin Manager better with much better impression while installing future patches into NetBeans 6.5. The new algorithm in Plugin Manager has been integrated just now, so in the daily development builds should be in a few days.
Just try it....