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 214181 - OrganizeImports run through Source/Inspect parses the source code again
Summary: OrganizeImports run through Source/Inspect parses the source code again
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 213182
  Show dependency tree
 
Reported: 2012-06-14 09:02 UTC by Jan Lahoda
Modified: 2012-06-26 12:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch. (1.61 KB, patch)
2012-06-14 09:02 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2012-06-14 09:02:02 UTC
Created attachment 120817 [details]
Proposed patch.

[recent sources]

When the OrganizeImports hint is run through Source/Inspect (and likely through Inspect&Transform as well), the hint will parse the source file again, leading to decreased performance. Not sure why I did not see it before, it may be random (depending on exact order of performing tasks), might have been hidden by other slow parts of the process (some fixed recently), or might have been miscategorized in the profiler snapshots. Anyway, seems forth fixing for 7.2 - see the attached patch.
Comment 1 Jan Lahoda 2012-06-14 17:44:53 UTC
Tomas, could you please review the patch? I would like to integrate both to trunk and NetBeans 7.2, if you would think its OK. Thanks.
Comment 2 Tomas Zezula 2012-06-15 06:46:59 UTC
The patch seems good to me.
Comment 3 Quality Engineering 2012-06-17 06:11:15 UTC
Integrated into 'main-golden', will be available in build *201206170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fcfcbf3370f4
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #214181: ensure that when a single-file task is run for the file currently processed by the multi-file task, nothing is parsed again
Comment 4 Jan Lahoda 2012-06-17 20:27:48 UTC
Jirka, could you please try to verify, so that I start the HR integration process? Taking a bigger project, run Source/Inspect selecting a configuration that includes Organize Imports. Build 201206150001 should be slower than build 201206170001. Please do not use any earlier build for this - there was another performance optimization in 201206150001.

To simplify the measurement, this option can be used:
-J-Dorg.netbeans.modules.analysis.RunAnalysis.level=0
With this option, the total time spent by analysis should be printed to the log (look for line containing "Total analysis time:"). The logger was introduced recently, but I think 201206150001 already has it.

Thanks.
Comment 5 Jiri Prox 2012-06-18 14:39:32 UTC
verified in trunk
Comment 6 Jan Lahoda 2012-06-21 09:29:34 UTC
release72:
http://hg.netbeans.org/releases/rev/6c94737b4cc4
Comment 7 Quality Engineering 2012-06-22 04:20:21 UTC
Integrated into 'releases', will be available in build *201206212341* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/6c94737b4cc4
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #214181: ensure that when a single-file task is run for the file currently processed by the multi-file task, nothing is parsed again
Comment 8 Jiri Prox 2012-06-26 12:50:26 UTC
verified