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

Summary: WhereUsedElement.create runs java lexer
Product: java Reporter: Jan Pokorsky <jpokorsky>
Component: RefactoringAssignee: Jan Pokorsky <jpokorsky>
Status: RESOLVED FIXED    
Severity: blocker CC: pflaska
Priority: P2 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 171692    
Bug Blocks: 171188    
Attachments: sna
snapshot of FindTask

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