Bug 89971 [Viewers] Viewers that use IViewerLabelProvider do too many instanceof checks
M6 Checking our viewer the calls to buildLabel are doing too many instanceof checks. As a result certain viewers (such as the table viewer) are twice as slow as they were in 3.0 due to these checks. I have written some performance suites to test the Table, Tree, List and Combo viewers. Table and Tree have this issue.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TreeEditor;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.TreeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.util.Assert;
/**
 * A concrete viewer based on an SWT <code>Tree</code> control.
 * <p>
 * This class is not intended to be subclassed outside the viewer framework. It
 * is designed to be instantiated with a pre-existing SWT tree control and
 * configured with a domain-specific content provider, label provider, element
 * filter (optional), and element sorter (optional).
 * </p>
 * <p>
 * Content providers for tree viewers must implement the
 * <code>ITreeContentProvider</code> interface.
 * </p>
 */
public class TreeViewer extends AbstractTreeViewer {