在 glibc 的官方 repository 裡面,
Making sure you're not a bot! 這邊可以看到說明,三個不同的 case:
Fast strstr algorithm with guaranteed linear-time performance.
Small needles up to size 3 use a dedicated linear search.
Longer needles up to size 256 use a novel modified Horspool algorithm.
Needles larger than 256 characters use the linear-time Two-Way algorithm.