Want for intermediate Rust book / docs: a clean cut tutorial on how to implement the Iterator trait. Took a while to figure out that for many cases we need to create a secondary struct that holds / borrows the primary struct and adds a counter / lifetimes. This isn't documented.
-
-
Anyway, I've implemented my first, actual iterator! This will allow us to Run Length Encode our bitfields in datrs/hypercore. This implementation will also be more efficient than the JS version because we can keep the pager sparse at all times :Dhttps://github.com/datrs/memory-pager/pull/6/files …
Show this thread -
New conversation -
-
-
Efficient ways to iterate and think about workload, possibly using rayon for parallelism if possible for seasoned would be one thing. This requires knowing how to profile your rust code to see if that iterator is even a hot spot for example
-
Oh yeah, that's a good one! Introducing parallel iterators (Rayon) / Future Streams might be at the edge of what's possible. Another one I'm thinking of is overloading the built-in trait implementations to tune them for performance. Yay, yeah that makes sense! :D
- 7 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.