Failure function — where it appears
Named by 2 essays across one field — each of them below, with the objects they name alongside it.
The shift the pattern already knows
On a text of 8,192 characters the naive scan examines 520,256 of them and Knuth–Morris–Pratt examines 16,321 — a factor of 32, and 16,321 is 99.6% of the 2n that no input can push it past. On ordinary random text the same two algorithms examine 20,862 and 20,833. Both measurements are of the same pair of algorithms and only one of them is the reason anybody uses the second.
One pass for every pattern at once
Sixty-four patterns, one text, twenty thousand characters read. Running this site's KMP once per pattern reads 1,595,445 — and an implementation missing one kind of link finds fewer occurrences, reads exactly as much, and looks better on every counter.
Named alongside it
The objects these essays reach for when they reach for this one.
Amortised analysisCharacter comparisonAho-corasickAlphabetAlphabet sizeAutomatonBacktrackingIndexKmpMeasured countNaive scanPattern matching