Bug 92161 - [DynamicUI] Avoid getDeclaringExtension().getNamespace()
Summary: [DynamicUI] Avoid getDeclaringExtension().getNamespace()
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Kim Horne CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-04-20 18:18 EDT by John Arthorne CLA
Modified: 2005-05-10 13:46 EDT (History)
3 users (show)

See Also:


Attachments
Patch for org.eclipse.ui.texteditor (2.83 KB, patch)
2005-04-21 09:32 EDT, Kim Horne CLA
no flags Details | Diff
Patch for org.eclipse.ui.editors (1.87 KB, patch)
2005-04-21 09:32 EDT, Kim Horne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2005-04-20 18:18:04 EDT
Build: I20050419

Now that the extension registry is loaded from disk lazily, every API call to
the extension registry is potentially slower.  One common example is code that
wants to find the plugin ID for a configuration element.  This is commonly done
like so:

IConfigurationElement.getDeclaringExtension().getNamespace()

Since obtaining the declaring extension might require loading from disk, the
namespace value is now cached on the configuration element.  Calls like the
above can now be replaced by:

IConfigurationElement.getNamespace()

This shorter call is 50% faster on average.  Here are the references I found in
the org.eclipse.ui.* plugins that can be improved in this way (I did a text
search for "getDeclaringExtension().getNamespace():

org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates -
ContributionTemplateStore.java
org.eclipse.ui.editors/src/org/eclipse/ui/texteditor -
MarkerAnnotationPreferences.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs -
WorkbenchWizardElement.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro -
IntroDescriptor.java (2 matches)
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc -
ExternalEditor.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/services -
WorkbenchPartFactory.java (2 matches)
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry -
StickyViewDescriptor.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry -
ViewDescriptor.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry -
WorkingSetDescriptor.java (2 matches)
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes -
ThemeRegistryReader.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal -
ActionDescriptor.java (2 matches)
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal - PartSite.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal - PluginAction.java
(2 matches)
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part - IntroPart.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part - WorkbenchPart.java
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences -
PreferenceTransferElement.java
org.eclipse.ui.workbench/Eclipse UI
Components/org/eclipse/ui/internal/components - ComponentUtil.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff -
ReferenceProviderDescriptor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling -
SpellingEngineDescriptor.java
org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor -
AnnotationPreference.java
Comment 1 Kim Horne CLA 2005-04-20 18:32:05 EDT
I've been doing this as I've found the cases so I'll go ahead and finish the rest.
Comment 2 Kim Horne CLA 2005-04-21 09:31:15 EDT
Marking fixed for the workbench cases.  Attaching patches that address the cases
in the text cases.
Comment 3 Kim Horne CLA 2005-04-21 09:32:20 EDT
Created attachment 20183 [details]
Patch for org.eclipse.ui.texteditor
Comment 4 Kim Horne CLA 2005-04-21 09:32:47 EDT
Created attachment 20184 [details]
Patch for org.eclipse.ui.editors
Comment 5 Dani Megert CLA 2005-04-22 05:45:52 EDT
Thanks for the patches.

Found another occurrence in org.eclipse.ui.texteditor.ConfigurationElementSorter
and also scanned and fixed Platform Search.
Comment 6 Kim Horne CLA 2005-05-10 13:46:18 EDT
Verified in I20050509-2010