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 82450 - [55cat] Slow parsing of annotation
Summary: [55cat] Slow parsing of annotation
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Adamek
URL:
Keywords: PERFORMANCE
: 82395 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-11 08:02 UTC by wulgar
Modified: 2006-09-12 12:49 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Commit log for 'stripped classpath' in EJB modules (11.62 KB, text/plain)
2006-08-25 00:19 UTC, Martin Adamek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wulgar 2006-08-11 08:02:12 UTC
I have 36 projects opened: 
2 EARs: first have 14 EJB modules, second 13
4 J2SE projects: Swing client and some libraries.

There is about 150 entities, 200-250 session beans and about 10 MDBs.

After startup, when Scanning classpaths disapears, 100% CPU load is for 15-20 min.

Configuration:
P4 2.8GHz, 1.3GB RAM, Windows XP Prof.
Comment 1 Petr Blaha 2006-08-11 08:50:59 UTC
*** Issue 82395 has been marked as a duplicate of this issue. ***
Comment 2 Martin Adamek 2006-08-22 17:32:06 UTC
I found that on startup even if NNListener instance was known, it was not always
used directly, but there was iteration over all listeners and checking of
classpath from cache and so on... I made some VERY primitive measurement. On my
machine opening (opening + later CPU load) of 2 EARs, 22 EJBs ans 1 WAR took 53
seconds. After applying simple patch the time decreased to 40 seconds. I hope
this is good start for performance enhancements. Can somebody else try to
measure this too?
http://j2ee.netbeans.org/source/browse/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/NNMDRListener.java?r1=1.1.2.26&r2=1.1.2.27
Comment 3 wulgar 2006-08-23 07:35:33 UTC
is this related?

http://www.netbeans.org/issues/show_bug.cgi?id=83250
Comment 4 Martin Adamek 2006-08-25 00:18:53 UTC
Next enhancement: stripped classpath is used (not using app server libraries)
for 'find usage' of annotations. On my sample project, now CPU is down
immediately after projects are open. Opening of the projects takes about 24s.
Comment 5 Martin Adamek 2006-08-25 00:19:51 UTC
Created attachment 33272 [details]
Commit log for 'stripped classpath' in EJB modules
Comment 6 Martin Adamek 2006-08-25 00:27:36 UTC
wulgar, can you please make measurement with new daily build? I am not sure when
are daily builds created, but for sure this change will be present in 20060826.
Thanks.
Comment 7 wulgar 2006-08-28 12:18:03 UTC
Starting NB is a pleasure now. But when I open entity class it does change
nothing. 100% CPU for 5 min.
Comment 8 Martin Adamek 2006-08-28 12:23:05 UTC
OK, nice to hear :-) I'll fix also JPA and Web annotation parsing, now only EJBs
are done.
Comment 9 Martin Adamek 2006-08-29 13:32:16 UTC
Now I realized the fix is not correct. Classpath for resolving of types should
not be stripped. It means that we will be back in bad numbers.
Comment 10 Milos Kleint 2006-09-05 10:29:49 UTC
while fixing this issue you seem to have broken the spi in a non-compatible way
by itroducing the getMetadataUnit() method to EjbJarImlementation. The change
was never submitted to apireviews. please rollback.

while being generally a bad practise, it also breaks 3rd party modules. see
http://jira.codehaus.org/browse/MEVENIDE-452.

Comment 11 Petr Jiricka 2006-09-05 13:57:56 UTC
Cau Milosi, since this is a friend API, we did not realize the Maven module was
using it. Martin is now working on addressing this issue - please wait until he
has the final solution for it, and then we will decide whether this change will
be rolled back, or whether some API change is needed. Thanks.
Comment 12 Milos Kleint 2006-09-05 14:57:04 UTC
cau, the maven support is not friends with anyone :)
EjbjarImplementation interface is in an api module with public packages. It's
there since 4.1 or 5.0 times.
Comment 13 Martin Adamek 2006-09-05 15:14:22 UTC
EjbJarImplementation is not in public api module. Check
http://www.netbeans.org/download/dev/javadoc/org-netbeans-modules-j2ee-api-ejbmodule/architecture-summary.html
It doesn't have explicit list of friends, but the API's stability is marked as
friend and there is no guarantee that nothing will be changed.
Comment 14 Milos Kleint 2006-09-05 17:39:29 UTC
oh well, I give up. 

just a side note: noone reads and cares about the stability level in the
architecture description document. I even doubt any of the info there is updated
after it was initially written. If there's code means to enforce a contract, it
should be used.
http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-vers
Comment 15 Martin Adamek 2006-09-11 20:44:06 UTC
Fixed. Please reevaluate. Very special thanks to Tomas Hurka for his help!
To API change: that's another story. Let's track it in issue 84646.
/cvs/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/Attic/NNMDRListener.java,v
 <--  NNMDRListener.java
new revision: 1.1.2.35; previous revision: 1.1.2.34
Comment 16 Andrei Badea 2006-09-11 23:58:44 UTC
This broke the commit validation.

Checking in NNMDRListener.java;
/cvs/j2ee/metadata/src/org/netbeans/modules/j2ee/metadata/Attic/NNMDRListener.java,v
 <--  NNMDRListener.java
new revision: 1.1.2.36; previous revision: 1.1.2.35
done
Comment 17 Martin Adamek 2006-09-12 05:26:54 UTC
Thanks for fix.
Comment 18 wulgar 2006-09-12 12:49:19 UTC
What about this?

http://www.netbeans.org/issues/show_bug.cgi?id=84692