Bug 220546 [Decorators] performance problem with resource manager in decoaration context
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.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecoratingStyledCellLabelProvider.java
protected StyledStringBuilder getStyledText(Object element) {
		StyledStringBuilder builder = super.getStyledText(element);
		if (this.decorator == null) {
			return builder;
		}
		String label = builder.toString();
		String decorated;
		if (this.decorator instanceof LabelDecorator) {
			decorated = ((LabelDecorator) this.decorator).decorateText(label,
					element, getDecorationContext());
		} else {
			decorated = this.decorator.decorateText(label, element);
		}
		if (decorated == null)
			return builder;
		int originalStart = decorated.indexOf(label);
		if (originalStart == -1) {
			return new StyledStringBuilder(decorated); 
														
		}
		if (decorated.length() == label.length())
			return builder;
		Styler style = getDecorationStyle(element);
		if (originalStart > 0) {
			StyledStringBuilder newString = new StyledStringBuilder(decorated
					.substring(0, originalStart), style);
			newString.append(builder);
			builder = newString;
		}
		if (decorated.length() > originalStart + label.length()) {