diff options
author | Alex Blewitt | 2015-08-31 08:56:41 +0000 |
---|---|---|
committer | Alex Blewitt | 2015-08-31 08:56:41 +0000 |
commit | f95c32bf1a73a13c50836db407acce8ea6c25eb0 (patch) | |
tree | de24d1b7fa74cea924a75425dd76b4914e3e28c2 /bundles | |
parent | 04d970f72e421446cac0947b1f81898b16e04ac2 (diff) | |
download | rt.equinox.framework-f95c32bf1a73a13c50836db407acce8ea6c25eb0.tar.gz rt.equinox.framework-f95c32bf1a73a13c50836db407acce8ea6c25eb0.tar.xz rt.equinox.framework-f95c32bf1a73a13c50836db407acce8ea6c25eb0.zip |
Bug 475924 - Measure activator class loading at bundle start
In order for a bundle to be started, the appropriate BundleActivator
must be located, then executed with a call to start(). However, the
lookup of the class itself may take some time, with the result that
the overall loading time of the bundle is not accurately represented.
By moving the start of the debug loading time to the start of the
method, the lookup for the BundleActivator class can be measured as
well as the call to start().
Change-Id: I6e69cdc7109bfb90d3b9bb61c52171a4fad6f900
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java index 8e1102f6e..a5797dc98 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java @@ -702,7 +702,12 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * method failed */ protected void start() throws BundleException { + long start = 0; try { + if (debug.DEBUG_BUNDLE_TIME) { + start = System.currentTimeMillis(); + Debug.println("Finding activator for " + bundle); //$NON-NLS-1$ + } activator = loadBundleActivator(); } catch (Exception e) { if (e instanceof RuntimeException) { @@ -712,9 +717,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, } if (activator != null) { - long start = 0; if (debug.DEBUG_BUNDLE_TIME) { - start = System.currentTimeMillis(); Debug.println("Starting " + bundle); //$NON-NLS-1$ } try { |