You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Basically, it's TextBuffer's fault. TextBuffer.findAllInRangeSync is going super slow at the beginning of the file.
Considering this and issues with find in replace in large files being really slow, it's obvious that TextBuffer needs some serious improvement.
Here is an imitation of the data file I'm working with (60k lines): sample-cave-data.txt
Moving forward by a word (w command) at the beginning of the file takes approx 240 ms per jump. Near the end of the file it only takes 1 ms per jump (see profiler output below).
240 ms is painfully slow. I'd like w to take 1 ms everywhere within a file of any size.
Slowness comes from TextBuffer.findAllInRangeSync. (TextBuffer also makes search and replace performance utterly pathetic in large files, so I don't blame vim-mode-plus for this really, thanks for all of your hard work!)
Thanks @jedwards1211 - @t9md if you find something specific in your investigation that you think the team should take a look at and it's not something you can resolve in vim-mode-plus, please let us know.
Investigated quickly.
vim-mode-plus depends on editor.scanInBufferRange and editor.backwardsScanInBufferRange heavily.
These function call TextBuffer's scanInRange internally.
The problem is although scanInBufferRange accept iterator which stops scanning at the given condition it collects all matching entries unnecessarily by calling findAllInRangeSync.
Maybe I believe the original assumption is findAllInRangeSync is fast enough for us to ignore this inefficiency.
But here, when scanRange become very big like 60K lines of buffer.
This inefficiency becomes significant.
I want text-buffer provide checking iterator line by line instead of preliminarily collect all entries then checking iterator.
What I can come up with to overcome current limitation is to implement own version of editor.scanInRange , but I don't think it is an ideal solution.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
See t9md/atom-vim-mode-plus#1113.
Basically, it's
TextBuffer
's fault.TextBuffer.findAllInRangeSync
is going super slow at the beginning of the file.Considering this and issues with find in replace in large files being really slow, it's obvious that
TextBuffer
needs some serious improvement.Edit by @rsese to copy the detailed issue description from t9md/atom-vim-mode-plus#1113
The text was updated successfully, but these errors were encountered: