Project: Eclipse_Platform_UI
Bug 318633 Part/editor switching is very slow
Reported: 2010-07-01 12:08:42 | Status: verified fixed

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

Files changed in fix:
bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/IStylingEngine.java bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SWTPartRenderer.java bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/UIStartupTest.java