Bug 211493 [Markers] [Markers] New Markers view slows down traversal in Package Explorer
I20071127-0800 Traversing over elements in the Package Explorer via Arrow_Down key is slowed down by the new Markers view. Steps: - select org.eclipse.jdt.doc.user (from CVS) - press Arrow_Right - press and hold Arrow_Down => selection moves slowly, gets faster after folders with many files have been passed I quickly profiled this and found that a lot of time is burned in org.eclipse.ui.internal.provisional.views.markers.CachedMarkerBuilder$1.run(IProgressMonitor) This is probably because ExtendedMarkersView.createPartControl(Composite) contains: ISelectionListener listener = getPageSelectionListener(); getSite().getPage().addSelectionListener(listener); listener.selectionChanged(getSite().getPage().getActivePart(), getSite().getPage().getSelection()); 1. => should not leak the listener when the view is disposed 2. => should not update when the Markers view is not visible 3. => should not use addSelectionListener() but addPostSelectionListener()
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/provisional/views/markers/ExtendedMarkersView.java
TreeViewerColumn column;
			if (i < currentColumns.length)
				column = new TreeViewerColumn(viewer, currentColumns[i]);
			else {
				column = new TreeViewerColumn(viewer, SWT.NONE);
				column.getColumn().setResizable(true);
				column.getColumn().setMoveable(true);
				column.getColumn().addSelectionListener(getHeaderListener());
			}
			column.getColumn().setData(MARKER_FIELD, markerField);
			
			column.setLabelProvider(new MarkerColumnLabelProvider(markerField,
					i == 0));
			column.getColumn().setText(markerField.getColumnHeaderText());
			column.getColumn().setToolTipText(
					markerField.getColumnTooltipText());
			column.getColumn().setImage(markerField.getColumnHeaderImage());
			if (builder.generator.getPrimarySortField().equals(markerField))
				updateDirectionIndicator(column.getColumn(), markerField);
		}
		
		if (currentColumns.length > fields.length) {
			for (int i = fields.length; i < currentColumns.length; i++) {
				currentColumns[i].dispose();
			}
		}
		viewer.getTree().setLayout(layout);
		tree.setLinesVisible(true);
		tree.setHeaderVisible(true);
		tree.layout(true);