Bug 239867 - ProfileSynchronizer.createProfileChangeRequest is inefficient
Summary: ProfileSynchronizer.createProfileChangeRequest is inefficient
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 16:04 EDT by Simon Kaegi CLA
Modified: 2008-08-12 09:58 EDT (History)
0 users

See Also:
john.arthorne: review+


Attachments
patch (3.09 KB, patch)
2008-07-09 13:03 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 16:04:11 EDT
ProfileSynchronizer.createProfileChangeRequest becomes an expensive call when the number of IUs available and installed in the profile gets high. For each avialable IU we're doing a linear search for matching IUs in the profile. In addition the set math done should use HashSets instead of an ArrayList.


See:
ProfileSynchornizer.createProfileChangeRequest (line 285 for the search and line 307 for the set match problems)
Comment 1 Simon Kaegi CLA 2008-07-09 13:03:43 EDT
Created attachment 106978 [details]
patch

This patch uses Hashsets for determining containment instead of iterating linearly over the various collections.
Comment 2 Simon Kaegi CLA 2008-07-14 17:45:05 EDT
I've committed to the 3.5 stream to allow further testing.
Comment 3 Simon Kaegi CLA 2008-08-08 01:44:14 EDT
Marking fixed along with bug 238312