Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 161073 - Don't use SourceFileManager for non sources
Don't use SourceFileManager for non sources
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Source
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Dusan Balek
issues@java
: PERFORMANCE
: 161913 (view as bug list)
Depends on:
Blocks: 153945
  Show dependency treegraph
 
Reported: 2009-03-24 21:28 UTC by Jan Pokorsky
Modified: 2009-05-21 13:12 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
snapshot preview (148.19 KB, image/png)
2009-03-24 21:29 UTC, Jan Pokorsky
Details
snapshot (699.99 KB, application/octet-stream)
2009-03-24 21:30 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2009-03-24 21:28:50 UTC
It seems to be necessary to implement caching of results in SourceFileManager. In case of JavaSource over multiple files
SourceFileManager.list significantly slows down JavacParser.moveToPhase. See the attached profiler snapshot and
especially
MoveTransformer.setWoringCopy->...->WorkingCopy.toPhase->...->JavacParser.moveToPhase->ErrorHandlingJavadocEnter.main->ProxyFileManager.list

As a test case I have used the refactoring rename action on org.gjt.sp.jedit package of the jEdit project. It runs
JavaSource.runModificationTask over ~280 java files.

Product Version: NetBeans IDE Dev (Build 090324)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Linux version 2.6.27-11-generic running on i386; UTF-8; en_US (nb)
Comment 1 Jan Pokorsky 2009-03-24 21:29:47 UTC
Created attachment 78786 [details]
snapshot preview
Comment 2 Jan Pokorsky 2009-03-24 21:30:46 UTC
Created attachment 78787 [details]
snapshot
Comment 3 Jan Jancura 2009-03-27 10:55:57 UTC
thanks!
Comment 4 Tomas Zezula 2009-04-07 09:11:22 UTC
*** Issue 161913 has been marked as a duplicate of this issue. ***
Comment 5 Tomas Zezula 2009-04-07 09:13:53 UTC
The problem seems to be in using wrong JavaFileManager, i will take care of it.
Comment 6 David Strupl 2009-04-14 13:53:08 UTC
Any news here? Feel free to re-assign to (?) ... Thanks.
Comment 7 Tomas Zezula 2009-04-14 14:30:50 UTC
I didn't get to such a big numbers. Only called for sources.
Comment 8 Dusan Balek 2009-05-21 08:49:25 UTC
The results caching is not necessary IMHO, since javac calls list(...) only once per package. The problem here is that
for each visited java file the new instance of javac compiler is created.
Comment 9 Dusan Balek 2009-05-21 08:58:54 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/9da7e6b0df5a
Comment 10 Pavel Flaska 2009-05-21 13:12:01 UTC
Manual measurement, find usages on jEdit class:
6.5.1
----
6,1s
5,3s
5,2s

6.7 w/o fix
---------
15,1s
15,3s
15,2s

6.7 w/ fix
--------
6,0s
6,0s
6,0s




By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo