Project: JDT
Bug 113247 [performance] investigate using a range index in AnnotationPainter or AnnotationModel
Reported: 2005-10-20 11:30:47 | Status: resolved fixed

3.2 M2 IAnnotationModel does not offer queries for annotations contained in a certain document range. This means that any client interested in a certain offset or range has to iterate over the entire model, collecting the interesting annotations itself: - AnnotationRulerColumn (to find the viewport-visible annotations) - SelectMarkerRulerAction (to find the annotations on a single line) - AbstractAnnotationHover (to find the annotations on a document region) - AnnotationPainter (intersection of document range and viewport-visible) Of these, especially AnnotationPainter and AnnotationRulerColumn are performance relevant as they are constantly updated when the document, the viewport or the annotation model changes. We should investigate the cost of maintaining a positional index of the contained annotations in AnnotationModel, which would allow to offer range based queries to clients. Queries could allow character or line ranges.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaAnnotationIterator.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java