Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 288827 - SourceModuleStructureRequestor.resolveDuplicates slow performance
Summary: SourceModuleStructureRequestor.resolveDuplicates slow performance
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dltk.common-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-08 09:54 EDT by Vadim Punski CLA
Modified: 2010-06-11 06:23 EDT (History)
1 user (show)

See Also:


Attachments
patch for resolve duplicates performance issue (2.07 KB, patch)
2009-09-08 09:57 EDT, Vadim Punski CLA
alex.panchenko: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Punski CLA 2009-09-08 09:54:52 EDT
Searching for duplicates in a large file, (for example long array definition several thousands elements) takes a lot of time.

The problem is searching for current maximum counter value using increments.

        protected void resolveDuplicates(SourceRefElement handle) {
		while (this.newElements.containsKey(handle)) {
			handle.occurrenceCount++;
		}
	}

takes n^2*o(1) times.
n elements, n searches in hashtable.
Comment 1 Vadim Punski CLA 2009-09-08 09:57:43 EDT
Created attachment 146663 [details]
patch for resolve duplicates performance issue

The solution suggested by Alex Panchenko.
Comment 2 Roy Ganor CLA 2009-09-08 10:08:55 EDT
committed to branch and head