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.

Bug 46253 - Do not use old Java source hierarchy
Summary: Do not use old Java source hierarchy
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: junit-issues@java
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 44105 45473
  Show dependency tree
 
Reported: 2004-07-16 18:32 UTC by _ rkubacki
Modified: 2006-03-24 10:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2004-07-16 18:32:40 UTC
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.
Comment 1 Tomas Pavek 2004-07-26 15:01:35 UTC
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?
Comment 2 _ rkubacki 2004-07-26 15:15:33 UTC
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.
Comment 3 arseniy 2004-07-26 16:21:39 UTC
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.
Comment 4 Martin Matula 2004-07-27 16:46:05 UTC
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.
Comment 5 Ondrej Rypacek 2004-07-29 16:58:26 UTC
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.
Comment 6 Ondrej Rypacek 2004-08-12 16:49:36 UTC
now, all test creation code is rewritten to JMI 
Comment 7 dmladek 2004-09-02 15:36:10 UTC
JUnit supports JDK1.5 new features now, so I guess it doesn't use the
java bridge