Project: Eclipse_Platform_UI
Bug 220546 [Decorators] performance problem with resource manager in decoaration context
Reported: 2008-02-27 08:40:58 | Status: verified fixed

20080217 I'm afraid the solution to use the IDecorationContext to provide a resource manager introduces a performance degregation. The DecoratorManager, who manages the light weight label decorations, stores decorations by context DecorationScheduler.resultCache<IDecorationContext, Map<DecorationResult>> Most label providers used the default context (DecorationContext.DEFAULT_CONTEXT). If there were several requests for the same image, all the requests were bundled and the result was only computed once before the result was broadcasted to all viewer. Now, with the new code, each label provider has its own instance of a decoration context. There will be separate computations per context. Even if two viewers want to decorate the same image, each of them will have to compute a DecorationResult The broadcast, however, still goes to all viewers.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecoratingLabelProvider.java bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecoratingStyledCellLabelProvider.java bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecorationContext.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IDecoratorManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationBuilder.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationResult.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/OverlayCache.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorCacheTest.java