Bug 92367

Summary: SourceElementParser performance
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 Keywords: performance
Version: 3.1   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
invocation times none

Description Martin Aeschlimann CLA 2005-04-22 09:30:32 EDT
20050422

For an other bug I was looking at the open editor performance:
- copy OS.java from swt.win32 to a new project -> several compiler errors in file
- open this file in a Java editor with outline
 -> 1419 fields, 4 initializers and 780 methods

What is interesting is that mostly in JavaElementInfo.addChild
When adding a child a 'contains' test is performed that compares each child with
each one resulting in over 1'000'000 calls of equals.
If that 'contains' test really required here? Whouldn't the SourceElementParser
only return different children?
Comment 1 Martin Aeschlimann CLA 2005-04-22 09:32:35 EDT
Created attachment 20236 [details]
invocation times

contact me for full snapshot
Comment 2 Martin Aeschlimann CLA 2005-04-22 09:33:16 EDT
build is 20050420 + jdt.core/ui HEAD from 20050422
Comment 3 Jerome Lanneluc CLA 2006-03-28 11:35:58 EST
Will keep this optimization for post 3.2
Comment 4 Jerome Lanneluc CLA 2006-03-31 09:07:14 EST
Reopening as this appears to be a bottleneck in latest
Comment 5 Jerome Lanneluc CLA 2006-03-31 09:07:37 EST

*** This bug has been marked as a duplicate of 134255 ***