This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Currently JUnit module creates tests using classes in org.openide.src. This works through the bridge to Java data stored in MDR and is slow and should be avoided. In fact new file is parsed 7-9x before it is generated. Although it has a progress indication tis action should be much faster than 3-4 seconds for a simple bean with one setter/getter pair.
I think that if the java source hierarchy got unusably slow then it is the bridge that should be fixed - and not all the users of the API should be forced to rewrite their code. This can be requested only within the java module IMHO. But if this is the only way to go... We can hopefully rewrite JUnit to use JMI directly. Is it somewhere described how to do this right (i.e. move from source hierarchy to JMI)? And mainly - how can we be sure this helps with the performance problems?
I don't agree with you Tomas. The bridge is here for backward compatibility and the API desing prevents us to significantly improve it as we cannot provide lazily populated objects from it so the most of time is spent to compute something what will be dropped. More generaly it is sometimes neceseary to rewrite parts of project to move further. We wouldn't get improvements in loaders without rewriting almost all modules. Do you think it was a mistake.
As Tomas already pointed out, the main question is whether rewriting to JMI will solve the performance problem with tests generation. Do we have a solid data on that to start with the (non-trivial) rewrite effort? It would be good to understand the root cause of the performance problem and then to concentrate on solving that in the first place for promo-D. Not using JMI in D is definitely not a P2 by itself.
The redundant parsing - i.e. most (if not all) of the performance problems of JUnit can be solved by wrapping the test generation by a transaction (begintTrans/endTrans calls) - that should be enough and is much less work than rewriting the whole module to use JMI instead of org.openide.src. Please let us know if you need some help with that.
fixed according to Martin's suggestion. The gain is approximately 30% for an action run on a whole package tree. Improvement for a single test is not measurable by hand. As there isn't any performance criteria mentioned here, please verify, that is enough or specify the criteria.
now, all test creation code is rewritten to JMI
JUnit supports JDK1.5 new features now, so I guess it doesn't use the java bridge