Skip to content

Comment on Bitap: My favorite string matching algorithmparent

Comments

Always been interested in using SIMD to speed up searching. So far though i have not found a really nice one.

Need to figure out what area they excel in - there is no one search that is the best for all types of data and pattern/search length.

I like burntsushi's string-searching work because it's well documented, split modularly into libraries/applications, and runs the gamut from low- to high-level (his blog posts and comments online are extremely helpful too). I use these three tools which he maintains:

Low level: memchr [1];

Medium level: Regex (Rust crate) [2];

High level: ripgrep [3].

Other names to look out for are the previously aforementioned Wojciech Muła, as well as Daniel Lemire (of simdjson [4][5]). Not SIMD-specific, but Data-Oriented Design can be a big help in terms of thinking about SIMD and cache-friendly data layout (as well as trimming down the work that the computer needs to do, generally). I've talked that to death, so I'll just link those comments here [6].

1. https://docs.rs/memchr/latest/memchr/

2. https://docs.rs/regex/latest/regex/

3. https://github.com/burntsushi/ripgrep

4. https://www.youtube.com/watch?v=wlvKAT7SZIQ

5. https://arxiv.org/pdf/1902.08318

6. https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.