eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

With very large documents the embedded search freezes the UI

Open laeubi opened this issue 4 months ago • 2 comments

If one edits large test documents ( > 150 MB) this works quite nice in Eclipse except if one uses the embedded search control.

The problem is that when one enter a character that is contained in the document it tires to highlight matches, this then could take very long and freezes the UI in the meanwhile.

I'm not sure what is slow, the search itself or the highlight of the results, but one idea would be to only perform the highlight for the portions of the document that is currently visible (+/- a few lines) and update only when the document is scrolled.

laeubi avatar Aug 24 '25 07:08 laeubi

I guess you are referring to the in-document search (with the in-document overlay that replaced the free-float dialog), is that correct? Then this issue probably fits to this umbrella:

  • https://github.com/eclipse-platform/eclipse.platform.ui/issues/2021

It sounds like a performance limitation when using search-as-you-type ("incremental" mode), which is enabled by default in that overlay. The dialog we had before (and that you can still switch back to in the preferences) should not have that issue if "incremental" is disabled. I think we somewhere discussed such a more fine-grained incremental search, but if I remember correctly this functionality is deeply integrated into the find/replace adapters of editors (or any other providers), so we would probably need extended interfaces and provider implementations for that.

HeikoKlare avatar Aug 24 '25 07:08 HeikoKlare

It sounds like a performance limitation when using search-as-you-type ("incremental" mode)

Yes lets assume the document contains a lot of = and i want to find the first occurrence of a === then one type = --> freeze for long time and for every typing a character more it freezes once again.

Its totally possible that it also happens with other functions but it become especially prominent with the in-document overlay and its enabled search-as-you-type.

One possible workaround would be to disable the search-as-you-type if the document is very large (in case you can query for the document size easily) and maybe show a warning that it was disabled because of that. It would totally fine for me in such case to explicitly trigger the search in such case, instead of freezing for many minutes.

laeubi avatar Aug 24 '25 08:08 laeubi