I would have found the article much better if there was more discussion of the "highly efficient indexOf function". It sidesteps the whole discussion of algorithms to appeal to some magic black box with no explanation of how it works - in this case it seems like the speed advantage might very well be because that's implemented in C rather than his KMP implementation which is all in Python. That's still a valid reason to use the approach instead if it means the result is faster, but I'd have preferred to see some more discussion of what was going on behind the scenes.