Bug 159190 [Viewers] multiple dispose listeners for elements in VIRTUAL tree viewer
3.3 Each time an element is mapped in a VIRTUAL tree viewer, a dispose listener is hooked to its item to properly unmap it. However, elements are mapped to the same item more than once (each time it is updated via doUpdateItem(Widget widget, Object element, boolean fullMap)). This results in many dispose listeners for each element to unmap it, which is a potential performance issue. The debugger subclasses the tree viewer and updates (clears) filtered children when an element is unmapped. It ends up doing the operation many times (once for each dispose callback), instead of once.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
* </p>
	 * 
	 * @since 3.2
	 */
	public void setChildCount(Object element, int count) {
		Tree tree = (Tree) doFindInputItem(element);
		if (tree != null) {
			tree.setItemCount(count);
			return;
		}
		Widget[] items = findItems(element);
		for (int i = 0; i < items.length; i++) {
			TreeItem treeItem = (TreeItem) items[i];
			treeItem.setItemCount(count);
		}
	}
	/**
	 * For a TreeViewer with a tree with the VIRTUAL style bit set, replace the
	 * given parent's child at index with the given element. If the given parent
	 * is this viewer's input, this will replace the root element at the given
	 * index.
	 * <p>
	 * This method should be called by implementers of ILazyTreeContentProvider
	 * to populate this viewer.
	 * </p>
	 * 
	 * @param parent
	 *            the parent of the element that should be updated
	 * @param index
	 *            the index in the parent's children