One function took 462 seconds to fingerprint. Here is the algorithm that turned that into a couple of seconds, and why it is really an old string-matching idea run backwards.