3 ms·
Agreed, this seems like a case of excessive complexity. I hadn't even heard of "two-way" before, but I don't think an algorithm the paper claims to be "remarkab
by userbinator 12y ago
Agreed, this seems like a case of excessive complexity. I hadn't even heard of "two-way" before, but I don't think an algorithm the paper claims to be "remarkably simple" should require twenty-five pages to describe.
"two-way" isn't all that fast either, so I don't see any good reason for its use; in the benchmarks I could find, the simpler BMH easily beats it (and optimised BMH variants go even faster):
http://volnitsky.com/project/str_search/benchmark-4.5.1.png http://volnitsky.com/project/str_search/benchmark-4.5.1.png
http://blog.phusion.nl/2010/12/06/efficient-substring-searching/ http://blog.phusion.nl/2010/12/06/efficient-substring-search...
- sitkack 12y agoIt would be interesting to put a trace on `strstr` for a couple days and see what the distribution of arguments look like. ToDo: Profile libc for various workloads, record arguments and code coverage