Bug 239860 - EquinoxBundleState.convert should use a hashmap lookup
Summary: EquinoxBundleState.convert should use a hashmap lookup
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 238312
  Show dependency tree
 
Reported: 2008-07-07 15:30 EDT by Simon Kaegi CLA
Modified: 2008-08-08 16:44 EDT (History)
0 users

See Also:
john.arthorne: review+


Attachments
patch (5.78 KB, patch)
2008-07-09 12:57 EDT, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2008-07-07 15:30:49 EDT
When converting BundleDescriptions to BundleInfo we end up doing a linear search for bundles with a matching location. This is n^2 because the search is done for every bundle. We should look at storing an index by location in EquinoxBundlesState or perhaps doing the iteration more efficiently in EquinoxBundlesState.convertState.

see:
EquinoxBundlesState.convert (for loop starting on line 440)
EquinoxBundlesState.convertState
Comment 1 Simon Kaegi CLA 2008-07-09 12:57:21 EDT
Created attachment 106976 [details]
patch

This patch create a HasMap by location of the current bundle info objects and uses this to lookup settings when converting each individual bundle.
Comment 2 Simon Kaegi CLA 2008-07-14 17:44:21 EDT
I've committed to the 3.5 stream to allow further testing.
Comment 3 Simon Kaegi CLA 2008-08-08 01:43:59 EDT
Marking fixed along with bug 238312