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 171652 - WhereUsedElement.create runs java lexer
Summary: WhereUsedElement.create runs java lexer
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: PERFORMANCE
Depends on: 171692
Blocks: 171188
  Show dependency tree
 
Reported: 2009-09-07 17:31 UTC by Jan Pokorsky
Modified: 2009-09-11 21:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sna (597.20 KB, text/plain)
2009-09-07 17:34 UTC, Jan Pokorsky
Details
snapshot of FindTask (597.20 KB, application/octet-stream)
2009-09-07 17:35 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-09-07 17:31:53 UTC
The attached profiler snapshot shows that a lot of time is consumed by creating WhereUsedElement/ElementGrip instances.
It takes same time as javac's parsing and attributing.

There are translations TreePathHandle -> TreePath that involve the NetBeans's java lexer needlessly. ElementHandle seems
to be suitable replacement here.

Another place starting the java lexer is ElementHeaders.getHeader(). As the usages nodes require only names of class
members, Element.getSimpleName should be sufficient here.
Comment 1 Jan Pokorsky 2009-09-07 17:34:39 UTC
Created attachment 87236 [details]
sna
Comment 2 Jan Pokorsky 2009-09-07 17:35:54 UTC
Created attachment 87238 [details]
snapshot of FindTask
Comment 3 Jan Pokorsky 2009-09-07 17:50:04 UTC
With patched sources I am getting 30-40% improvement for the jEdit query. In case of DBObject it is a bit worse as it
reaches the default memory limit and GC takes place.
Comment 4 Jan Pokorsky 2009-09-08 13:13:19 UTC
fixed as jet-main 0a433c7a7114

Pavle could you verify it please?
Comment 5 Quality Engineering 2009-09-11 21:39:22 UTC
Integrated into 'main-golden', will be available in build *200909111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0a433c7a7114
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #171652: performance fix not to start java lexer