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 161073

Summary: Don't use SourceFileManager for non sources
Product: java Reporter: Jan Pokorsky <jpokorsky>
Component: SourceAssignee: Dusan Balek <dbalek>
Status: VERIFIED FIXED    
Severity: blocker CC: issues, mmirilovic, tzezula
Priority: P2 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 153945    
Attachments: snapshot preview
snapshot

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