Excerpt: "The result of this is that, in the limit, GNU grep averages fewer than 3 x86 instructions executed for each input byte it actually looks at (and it skips many bytes entirely)."
However note https://news.ycombinator.com/item?id=19522987
> It does not. ripgrep does not use Boyer-Moore in most searches.
> In particular, the advice in [the freebsd mailing list post] is generally out of date.
although the out of date bits are really the Boyer-Moore ones: https://lobste.rs/s/ycydmd
> much of Mike Haertel’s advice in this post is still good. The bits about literal scanning, avoiding searching line-by-line, and paying attention to your input handling are on the money.
> But the stuff about Boyer-Moore is outdated.
Try
/usr/bin/find . -depth -type f -print | /usr/bin/xargs -i /usr/bin/fgrep string '{}'
and run it several times so that the filesystem cache is primed.
Which you'd know if you'd wondered, because that's something /u/burntsushi regularly explains: https://blog.burntsushi.net/ripgrep/#literal-optimizations
https://blog.burntsushi.net/ripgrep/
(It seems down at the moment you can try the cached version)