-
Notifications
You must be signed in to change notification settings - Fork 2
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
perf: don't process the entire body of text for every movement #4
Comments
It is also setting new marks for existing marked positions on all Edit: I have two ideas to address this:
|
5676c99 improves deletion speed at least for large selections in charwise visual. For some large files I tested on, this is a dramatic improvement. Specifically, some papers in LaTeX, with many wrapped lines, were much smoother. |
The We attempted using interval trees and had a functioning implementation, but it was orders of magnitude slower: 1.2 to 1.5 seconds to instantiate the tree, while our naive approach is around |
As of right now, the plugin gets the entire visual selection and parses it for whitespace on every
CursorMoved
. For example, if we have 100 lines selected and we move down one line, we get the entire 101 lines and parse it again, despite extmarks already existing. We do not need to parse the entire thing again.We should be able to improve performance by only parsing the text between the last cursor position during visual mode and the current cursor position. For example, instead of parsing the entire 100 lines again just to add extmarks to one line, start at the last cursor position (row, col) and just parse up to the new row col.
The text was updated successfully, but these errors were encountered: