Bug 271621 - [simpleconfigurator] Expensive manifest localization on startup
Summary: [simpleconfigurator] Expensive manifest localization on startup
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 270815
  Show dependency tree
 
Reported: 2009-04-08 09:48 EDT by John Arthorne CLA
Modified: 2009-04-13 17:17 EDT (History)
2 users (show)

See Also:


Attachments
Profiler trace from fourth invocation of headless startup test (16.71 KB, text/plain)
2009-04-08 09:50 EDT, John Arthorne CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2009-04-08 09:48:01 EDT
I am running YourKit on the core headless startup performance test. About 11% of the total test time is inside ConfigApplier.installBundles when it invoktes Bundle.getHeaders(). This results in expensive lookup of localized manifest data. Tom suggested some optimizations:

1) Use getHeaders("") to prevent localization. They header we care about here isn't localized.

2) Perhaps the FRAGMENT_HOST header could be cached by the framework

3) Should this code even be running at all on second startup?
Comment 1 John Arthorne CLA 2009-04-08 09:50:03 EDT
Created attachment 131280 [details]
Profiler trace from fourth invocation of headless startup test
Comment 2 Thomas Watson CLA 2009-04-08 09:59:21 EDT
(In reply to comment #0)
> I am running YourKit on the core headless startup performance test. About 11%
> of the total test time is inside ConfigApplier.installBundles when it invoktes
> Bundle.getHeaders(). This results in expensive lookup of localized manifest
> data. Tom suggested some optimizations:
> 
> 1) Use getHeaders("") to prevent localization. They header we care about here
> isn't localized.
> 

Should probably use PackageAdmin.getBundleType for the fastest way to find out if a bundle is a fragment.

> 2) Perhaps the FRAGMENT_HOST header could be cached by the framework
> 
> 3) Should this code even be running at all on second startup?
> 

I know update configurator used to figure out if it needed to do some extra work.  Not sure what all the issues are with doing that in simple configurator.
Comment 3 Simon Kaegi CLA 2009-04-08 10:14:52 EDT
Thanks Tom. 
Trying this out in a test but should commit it to HEAD shortly.
Comment 4 Simon Kaegi CLA 2009-04-08 10:41:21 EDT
Fixed in HEAD.

From what I saw in my testing this introduced around 200ms (on my machine) on second startup, but a truly massive amount of overhead (e.g. multi-second) on the first start. Great catch John.
Comment 5 John Arthorne CLA 2009-04-13 17:17:29 EDT
Unfortunately there was no net improvement with this fix, because now another bundle pays the manifest localization hit (see bug 272087). I think we won't see the benefit from this fix until that other bug is also fixed.