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 158360

Summary: Performance - Move a Class
Product: java Reporter: stefan79 <stefan79>
Component: RefactoringAssignee: Jan Pokorsky <jpokorsky>
Status: RESOLVED FIXED    
Severity: blocker CC: issues
Priority: P3 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 133914    
Attachments: The nps-File while moving the class
MoveTransformer.nps

Description stefan79 2009-02-11 08:53:11 UTC
Moving one class takes about 20-30 Seconds.
I think this to much.

The class:
 -) has an extends clause
 -) implements an interface
 -) No directly dependencies on this class

project:
 -) 2824 Source-Files

Tested on WindowsXP with night-build (200902050256).
Comment 1 stefan79 2009-02-11 08:53:56 UTC
Created attachment 76835 [details]
The nps-File while moving the class
Comment 2 Jan Pokorsky 2009-03-10 15:57:47 UTC
Product Version: NetBeans IDE Dev (Build 090305)
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)

Reproducible. Time depends on number of usages of the moved class. As a test case I use the jEdit project (561 java
files) and class org.gjt.sp.jedit.ActionSet. It has 49 occurences in ~11 files and preview of Move refactoring takes ~40 s.

From profiling of MoveTransformer I guess it would help to minimize usages of SourceUtils.getFile that is really expensive.
Comment 3 Jan Pokorsky 2009-03-10 16:02:46 UTC
Created attachment 77989 [details]
MoveTransformer.nps
Comment 4 Jan Pokorsky 2009-03-10 16:04:07 UTC
*** Issue 157123 has been marked as a duplicate of this issue. ***
Comment 5 Jan Pokorsky 2009-03-12 13:41:52 UTC
I have significantly reduced invocations of SourceUtils.getFile and now I can do Move Class refactoring of
org.gjt.sp.jedit.ActionSet in ~10 s. In case of the Rename refactoring of org.gjt.sp.jedit package it helps even better.
From tens minutes measured with NB 6.5 to tens seconds.

http://hg.netbeans.org/main/rev/38dec86d6046
Comment 6 Quality Engineering 2009-03-18 22:33:37 UTC
Integrated into 'main-golden', will be available in build *200903181604* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/38dec86d6046
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #158360: caching SourceUtils.getFile to speed up rename package and move refactoring
Comment 7 Jan Pokorsky 2009-03-26 14:58:17 UTC
*** Issue 154964 has been marked as a duplicate of this issue. ***
Comment 8 Jan Pokorsky 2009-04-07 12:21:58 UTC
*** Issue 159487 has been marked as a duplicate of this issue. ***
Comment 9 Jan Pokorsky 2009-04-07 12:24:52 UTC
fixed in 6.7m3