Bug 253773 [Viewers] Collapsed expandable nodes in a TreeViewer are needlessly expensive
In the Expressions view, the debug platform TreeViewer needlessly causes the model to be queried for all children of collapsed expandable items. This can have serious performance repercussions. This can be easily seen in a CDT gdb debug session. Create a simple C project with the following main(). Launch a debug session and add 'arr1' and 'arr2' in the Expressions view. Don't expand them. Simple step through the loop. Every step takes about 3-4 seconds on a relatively fast machine. Close the Expressions view, stepping becomes instantaneous. int main() { int arr1[100]; int arr2[100]; while (1) { int i = 1; i++; } return arr1[0] + arr2[0]; }
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
* (non-Javadoc) Method declared in AbstractTreeViewer.
	 */
	protected int getItemCount(Control widget) {
		return ((Tree) widget).getItemCount();
	}
	/*
	 * (non-Javadoc) Method declared in AbstractTreeViewer.
	 */
	protected int getItemCount(Item item) {
		return ((TreeItem) item).getItemCount();
	}
	/*
	 * (non-Javadoc) Method declared in AbstractTreeViewer.
	 */
	protected Item[] getItems(Item item) {
		return ((TreeItem) item).getItems();
	}
	/**
	 * The tree viewer implementation of this <code>Viewer</code> framework
	 * method ensures that the given label provider is an instance of either
	 * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>. If
	 * it is an <code>ITableLabelProvider</code>, then it provides a separate
	 * label text and image for each column. If it is an
	 * <code>ILabelProvider</code>, then it provides only the label text and
	 * image for the first column, and any remaining columns are blank.
	 */
	public IBaseLabelProvider getLabelProvider() {
		return super.getLabelProvider();
	}
	/*