Search View: Performance issues on remove and sort#3733
Conversation
|
@mehmet-karaman : please first create a ticket and explain the problem. |
2a62c61 to
73cab0d
Compare
dff7693 to
300ca6b
Compare
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
300ca6b to
fe5e861
Compare
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
fe5e861 to
7f02394
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses Search View performance and correctness when removing matches, by enabling batch removal at the “enclosing element” (e.g., file/resource) level and ensuring removals aren’t limited to only currently visible (element-limited) results.
Changes:
- Updated
AbstractTextSearchViewPage.internalRemoveSelected()to batch-remove matches by selectedIFile/IContainerresources before falling back to per-match removal for non-resource selections. - Added
AbstractTextSearchResult.removeElements(...)to remove all matches for selected elements via a single map-entry removal per element.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java |
Adds resource-aware pre-processing in “Remove Selected Matches” to remove matches by file/container in a batch. |
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java |
Introduces an element-based batch removal method to efficiently drop all matches for selected elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
4cd364f to
b53503b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
17ec4af to
fc2f401
Compare
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
fc2f401 to
40ee202
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
Outdated
Show resolved
Hide resolved
40ee202 to
7d37158
Compare
7d37158 to
d572e09
Compare
|
We're seeing many problems in many builds, including this one. https://ci.eclipse.org/platform/job/eclipse.platform.releng.aggregator/job/PR-3680/12/console |
|
@merks : I've also heard about failing egit nightly builds due slow execution. Looks like something issue affects many different projects. |
|
I asked @fredg02 about known problems, but the team is not aware of any general problem, though they are keeping their eyes out. |
iloveeclipse
left a comment
There was a problem hiding this comment.
I have few comments on tests, beside this looks OK
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
a15430b to
7adb6b1
Compare
|
@mehmet-karaman : please if you push, resolve all things that are resolved. |
iloveeclipse
left a comment
There was a problem hiding this comment.
I will push extra commit with test fixes and a TODO that must be implemented
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
48dd9b0 to
2950265
Compare
|
Failed test on Linux: org.eclipse.jface.text.tests.reconciler.AbstractReconcilerTest.testReplacingDocumentWhenClean() Locally it worked on windows. Searched in github issues and found: #2708 |
2950265 to
0551806
Compare
|
@iloveeclips I've replaced the job join thing with a refresh of the viewer, which triggers the content provider. |
|
The test shows exact the (sporadic) fail I've seen before: |
|
Started a new trial.. Added this on line 81 to see when we have the results in the view This snipped helped to get catched in an endless loop and try different things out until the directElements gets entries. The following snippet after the system.out.println("Empty") helped to get out of the endless loop: This solves our test problem, but I still don't have an answer why refresh() didn't helped and setInput() had to be called.. At that point the Input was equal equal to the searchResult object. |
0c003e9 to
6e502c9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.search.tests/src/org/eclipse/search/tests/TextSearchResultTest.java
Show resolved
Hide resolved
bundles/org.eclipse.search/newsearch/org/eclipse/search/ui/text/AbstractTextSearchResult.java
Show resolved
Hide resolved
55c96a0 to
d982bda
Compare
- Implemented a batch removal of search matches - Search matches are removed from their parent, instead of one by one which causes performance issues - It's also fixing the problem, that all elements are removed instead only the visible elements (while all others are filtered by the limit number) - Replaces the ConcurrentHashMap.newKeySet() with the ConcurrentSkipListSet with the comparator and makes the additional sorting obsolete. - After this change, avoid using `size()` on values, because it is not more constant time operation, see `ConcurrentSkipListSet` javadoc. - Also comparator must be changed to consider different Match elements with same size and offsets in the set - otherwise the `ConcurrentSkipListSet` would lost them. - Added `AbstractTextSearchResult.hasMatches(Object element)` API for cases where match count not needed. - If possible, calls to `size()` changed to `isEmpty()` or omitted. - Implemented Tests Fixes eclipse-platform#3735 Co-authored-by: Andrey Loskutov <loskutov@gmx.de>
d982bda to
526db36
Compare
|
Thanks Mehmet. |
|
Thank you too. |
which causes performance issues
only the visible elements (while all others are filtered by the limit
number)
ConcurrentHashMap.newKeySet() with the ConcurrentSkipListSet with the
comparator and makes the additional sorting obsolete.
Fixes #3735