Comment by sylware
What is the string sizes thresold for efficiency?
Because the SIMD (aligned, size computations, etc) setup code is usually more expensive that byte-oriented basic search for "small" strings.
Yes, it depends heavily on the hardware architecture.
Here, it's often the opposite.
These algorithms are basically brute force with very little setup, and can become quadratic for large, periodic needles.
String search algorithms that avoid quadratic behaviour (and may even be sublinear) have an higher cost setup that explores needle structure