Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve 'Replace All' performance. #2258

Merged

Conversation

raghucssit
Copy link
Contributor

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

@raghucssit
Copy link
Contributor Author

@iloveeclipse FYI.

@raghucssit
Copy link
Contributor Author

Performance Data:
Please use the generator attached in the issue. It generates 20k inner classes with a method in it. A total 40k annotations.
and 20k occurrence of replace string.
In this example:
Without Fix: Always >40 Seconds
With Fix: Always <30 seconds.

My machine configuration:
Processor: 16 × Intel® Xeon® W-2245 CPU @ 3.90GHz
Memory: 125.0 GiB of RAM
OS: RHEL 9.2

Copy link
Contributor

github-actions bot commented Sep 9, 2024

Test Results

 1 815 files  ±0   1 815 suites  ±0   1h 30m 13s ⏱️ - 5m 24s
 7 699 tests ±0   7 469 ✅  - 2  228 💤 ±0  2 ❌ +2 
24 258 runs  ±0  23 509 ✅  - 2  747 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 530fa43. ± Comparison against base commit c603575.

♻️ This comment has been updated with latest results.

@Wittmaxi
Copy link
Contributor

This is something I had suspected but never taken the time to investigate into. Thank you for the contribution, I support it.

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
@iloveeclipse
Copy link
Member

I've just rebased the commit, no other changes

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iloveeclipse iloveeclipse merged commit c9b34e4 into eclipse-platform:master Oct 1, 2024
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants