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 - Performance - Move a Class
Summary: Performance - Move a Class
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: PERFORMANCE
: 154964 157123 159487 (view as bug list)
Depends on:
Blocks: 133914
  Show dependency tree
 
Reported: 2009-02-11 08:53 UTC by stefan79
Modified: 2009-04-07 12:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The nps-File while moving the class (196.34 KB, application/octet-stream)
2009-02-11 08:53 UTC, stefan79
Details
MoveTransformer.nps (872.37 KB, application/octet-stream)
2009-03-10 16:02 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
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