ashvardanian / StringZilla

Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging NEON, AVX2, AVX-512, and SWAR to accelerate search, sort, edit distances, alignment scores, etc 🦖
https://ashvardanian.com/posts/stringzilla/
Apache License 2.0
2.05k stars 66 forks source link

Add search/split iterators for Rust #79

Open ashvardanian opened 7 months ago

ashvardanian commented 7 months ago

In C++ we have special smart iterators for bulk search and split operations. They lazily report the matches, avoiding heap allocations for the array of match offsets.

For that, an arbitrary matcher (string / character / character set ; in normal / reverse order) is combined with search / split ranges. Similar functionality should be added in Rust.

ashvardanian commented 7 months ago

Assuming search and split operations are lazy by default on native strings, I’m wondering if there is a way to avoid reimplementing those operations and still benefit from SZ speeds.

grouville commented 6 months ago

Would you be interested in me investigating this issue ? I can come up with a proposal as a draft PR too

ashvardanian commented 6 months ago

Yes, @grouville, that can be very useful, thank you!