Skip to content

Commit

Permalink
Improve 'Replace All' performance.
Browse files Browse the repository at this point in the history
For Large Java file 'Replace All' takes long time and freezes the UI.
One of the reason is Projection Model tries to iterate over all the
Projection Annotations to expand/collapse status.
We can improve this situation by using Region specific iterator. This
returns annotations which are enclosed by given offset.
This improves the performance by 25% at least.

See eclipse-platform#2257
  • Loading branch information
raghucssit committed Sep 9, 2024
1 parent 5c74619 commit dabedbe
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected boolean expandAll(int offset, int length, boolean fireModelChanged) {

boolean expanding= false;

Iterator<Annotation> iterator= getAnnotationIterator();
Iterator<Annotation> iterator= getAnnotationIterator(offset, length, true, true);
while (iterator.hasNext()) {
ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
if (annotation.isCollapsed()) {
Expand Down

0 comments on commit dabedbe

Please sign in to comment.