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 #2257
  • Loading branch information
raghucssit authored and iloveeclipse committed Sep 24, 2024
1 parent c603575 commit 530fa43
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 530fa43

Please sign in to comment.