Closed vadi2 closed 3 years ago
That does't sound very good. I have to look into this. ( Unfortunately I don't have much time these days for Edbee).
My first impression is that the markAll and searchAll functions are very inefficient, because it uses a 'findNextRange' call for every item searched.
FindNextRange is a method that can called separately. A much better approach would be to use 1 call that uses the regexp just once in a loop. So an optimised rewrite of markAll without calling findNextRange would be a solution
Btw. VSCode probably uses threading for searching in the background.
@vadi2 Could you check if this improves the situation?
We are good on this now, thank you :+1:
We've got this bit of code that we're using to highlight search matches:
And when we use it on say a 1,000 line document like this, highlighting a single character like
c
takes a really long while:Are we using the API right or is there something that can be done?
We've already disabled highlighting for one or two character searches, but that's more of a workaround than a solution, since VS Code on the same machine handles it okay.