AvalonEdit icon indicating copy to clipboard operation
AvalonEdit copied to clipboard

Search operation executes on dispatcher thread

Open dmit25 opened this issue 9 years ago • 3 comments

Hi, this project is just brilliant and I've been using it for a couple years for now. The only one problem is UI freezes when working with huge documents >10Mb and active search running. The root of the problem is that offsets calculation process is running in the main UI thread, matching big text using regexps takes a lot of time ( e.x. on my machine when 20 Mb file is opened and any type of search active any keypress leads to 2,2 secs delay, matching text with simple regex takes about 2,1 secs). So the first thought - move matching phase to another thread, additionally add interception code in each iteration so that any running background process could be easily stopped by new one (typing -> search started, typing before search completed -> search process stopped and new one started).

I've worked a bit on this problem and have some implementation in my fork (worked out dispatcher issues + interception implementation), no more freezes during typing + simplified search dependencies, unfortunately I've abandoned some search functionality? but I'm sure that with your help we can implement match whole word without document dependency (so it could run in parallel thread).

If you are interested in this type of functionality I can upload performance reports and send pull request.

Again, thanks for your work.

dmit25 avatar Jun 08 '15 07:06 dmit25

Would you still be interested/able to provide your changes as a pull request?

siegfriedpammer avatar Feb 04 '20 13:02 siegfriedpammer

Oh, I no longer work with this library, but I guess it is possible to pick up changes from my fork. I guess it's not urgent :) I'll try to create a proper PR.

dmit25 avatar Feb 04 '20 15:02 dmit25

Honestly, I did not expect a response... take your time :) Thank you very much!

siegfriedpammer avatar Feb 04 '20 15:02 siegfriedpammer