Bug 318633 Part/editor switching is very slow
Build Identifier: I20100630-1856 Switching between editors and parts is very slow (tested on a Core 2 T5600 under Windows 7). Delay is about 2 seconds. I did a quick analysis with the YourKit Java Profiler. Here is what I did: 1. Open two text files (almost empty) 2. Start the profiler 3. Switch from one editor to the other 4. Stop the profiler Thus, there was only a single focus transfer. The results are (see also attached screenshots): Most of the time is consumed by the invocation of java.lang.reflect.Method.getParameterAnnotations(). For a single focus transfer, this method is called several thousand times. The back traces show that these inovations come from the setId() and setClassname() methods in the PartRenderingEngine, which in turn gets called on part activation (WBWRenderer.trackActivePart(...)). Unfortunately, I cannot tell which method in the stack trace actually causes these many invations, because the invocation counts in the profiler are not shown (for some unknown reason). Is there a way to reduce this high count of invocations? This would greatly improve the editor switching time. Reproducible: Always
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
public static final String LOCAL_ACTIVE_SHELL = "localActiveShell"; 
	public static final String XMI_URI_ARG = "applicationXMI"; 
	public static final String CSS_URI_ARG = "applicationCSS"; 
	public static final String CSS_RESOURCE_URI_ARG = "applicationCSSResources"; 
	public static final String PRESENTATION_URI_ARG = "presentationURI"; 
	public static final String LIFE_CYCLE_URI_ARG = "lifeCycleURI"; 
	public static final String SAVE_AND_RESTORE = "saveAndRestore"; 
	public static final String INITIAL_WORKBENCH_MODEL_URI = "initialWorkbenchModelURI"; 
	public static final String INSTANCE_LOCATION = "instanceLocation"; 
	public static final String MODEL_RESOURCE_HANDLER = "modelResourceHandler"; 
	public static final String RENDERER_FACTORY_URI = "rendererFactoryUri"; 
	IEclipseContext appContext;
	IPresentationEngine renderer;
	MApplication appModel = null;
	public IEclipseContext getContext() {
		return appContext;
	}
	public E4Workbench(MApplicationElement uiRoot, IEclipseContext applicationContext) {
		appContext = applicationContext;