Project: Eclipse_Platform_UI
Bug 92161 [DynamicUI] Avoid getDeclaringExtension().getNamespace()
Reported: 2005-04-20 18:18:04 | Status: verified fixed

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

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI Components/org/eclipse/ui/internal/components/ComponentUtil.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActionDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/services/WorkbenchPartFactory.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/StickyViewDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorUtils.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/preferences/PreferenceTransferElement.java