-
Notifications
You must be signed in to change notification settings - Fork 46
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
Make Lines iterator more efficient #25
Comments
I was exploring this issue this weekend and I think I have a possible solution, I'll try to post a PR within the month :), it needs lots of polishing and perf testing (thankfully testing for correctness is just comparing to the slow version so that part is easy) |
That's a bit unfortunate timing we did some duplicate work here (see my comment in helix-editor/helix#4457). Perhaphs we can combinme efforts |
Currently the
Lines
iterator is roughly equivalent to just callingRope::line()
repeatedly with an incrementing index. This is O(log N) for each call toLines::next()
, and also is just generally less efficient than it needs to be. This is not only sub-optimal, but also stands out compared to the other iterators which are all O(1) and very fast.It should be possible to also make
Lines
O(1) and just generally more efficient.The text was updated successfully, but these errors were encountered: