Bug 239516 - getEclipseRealLocation does unnecessary work
Summary: getEclipseRealLocation does unnecessary work
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-03 16:21 EDT by Simon Kaegi CLA
Modified: 2008-08-08 01:44 EDT (History)
1 user (show)

See Also:
john.arthorne: review+


Attachments
patch (1.00 KB, patch)
2008-07-03 16:21 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-03 16:21:53 EDT
Created attachment 106513 [details]
patch

While profiling for bug 238312 I noticed that getEclipseRealLocation is doing some unnecessary work. We try interpreting an incoming location string as an URL which is not really necessary in this case. This unfortunately triggers the URL parsing code which can be expensive. A far simpler check will suffice.

This might normally not be a big deal however in larger installs the number of calls to getEclipseRealLocation grows faster than linearly because of the way we check bundle locations. The attached fix does not attempt to alter the overall algorithm but nonetheless removing the URL parsing step has a noticeable impact on installs with >500 bundles.

Starting from a 3.4 SDK and adding 500 dummy bundles: savings approx. 1 sec
Starting from a 3.4 SDK and adding 4000 dummy bundles: savings approx. 100 sec
Comment 1 Simon Kaegi CLA 2008-07-14 17:44:07 EDT
I've committed to the 3.5 stream to allow further testing.
Comment 2 Simon Kaegi CLA 2008-08-08 01:43:50 EDT
Marking fixed along with bug 238312