Well after reviewing your PR. I think I would suggest a few things:
- The choice of
Vecdeque is good but one thing to note it is not a continginous data structures meaning it will have cache misses alot which can really slow things down if you are reading data alot which is not great. So I would suggest if you can just implement your own dequeue from scratch using purely vectors as they tend to be contigenous and less prone to cache misses. Thus improving performance.
Also, when you implement your own deque structure and if you need to have the need to implement find/search function I think you can take the help of iterators for that like iter + find or iter + filter though I assume they should be O(1) in time complexity seeing the lazy nature of iterators and reading the std library docs though I will still leave the confirmation of whether it is O(1) on Helix(noop_noob) & noratrieb because I could be wrong with this one ๐
.
- I would suggest using iterators more than loops because they have zero cost abstraction and are slightly more performant than loops which becomes more pronounced if you iterate over large number of elements.
Other than that I would suggest setting up clippy lints like:
#![forbid(unsafe_code, clippy::panic)]
#![deny(missing_docs, clippy::missing_docs_in_private_items, clippy::perf)]
#![warn(clippy::cognitive_complexity, rust_2018_idioms)]
Which can really help diagnose your code easily and suggest code suggestion to improve code readability and performance. Though note don't copy and paste the above example blindly I would strongly suggest reading each lint carefully before you do so. ๐