Community
Participate
Working Groups
Initialization of Plug-in Registry view is very slow, especially when a number of plug-ins is high (e.g. >400).
Created attachment 183684 [details] patch This patch increases speed significantly. Here are some results for two different target platforms: 1) 197 plug-ins Current: 7155 With patch: 648 1) 441 plug-ins Current: 19535 With patch: 1478 I have tested it and there are not any regression problems.
Looking at the patch, I found it very surprising to see that the performance difference is so significant. The search being done in the patch is essentially the same as what is done in the state. However, it appears that asking the platform admin for the state actually creates a new State each time it is called. Even though it is based on the current state, the method has to create new bundle descriptions for each bundle. cc'ing Tom for comment. It feels like PlatformAdmin should mention in the javadoc that it creates a new state. Is there a way to get the cached system state? I don't see anything wrong with the patch asking the bundle context for the current bundles, but if we have a state, it would be better.
Created attachment 183705 [details] updated patch It looks like the problem can be also solved in a different way. Curtis, you are right that method PlatformAdmin.getState() creates new state for each call. The cause we request for a mutable state. If we need to get a state only for reading (in our case) we can call PlatformAdmin.getState(boolean) with false and then we do not create a new state object. I have attached a patch. It makes the same improvement as a previous one.
Fixed in HEAD. Thanks for the patch!