Generator

Characters examined searching 20,000 for a pattern of 8

Rendered here at the parameters it defaults to, with every essay that calls it — which is the same list as the blast radius of changing it.
Characters examined searching 20,000 for a pattern of 8random over 26 symbols. Every matcher returns the same 1 occurrence; what differs is what it read to get there. Rabin–Karp examined 8 characters, which is 0.00 per character of text. The naive scan examined 20,862.characters examinedNaive scan20,8621.04 per text characterKnuth–Morris–Pratt20,8331.04 per text characterBoyer–Moore–Horspool2,9850.15 per text characterRabin–Karp80.00 per text characterone unit = one character comparison2607.8× between best and worst

Characters examined searching 20,000 for a pattern of 8

random over 26 symbols. Every matcher returns the same 1 occurrence; what differs is what it read to get there. Rabin–Karp examined 8 characters, which is 0.00 per character of text. The naive scan examined 20,862.

Drawn at 700 × 236, wide on the page. Everything above is what match-cost returns with no arguments; the caption is the generator's own, computed from the numbers in the drawing rather than written beside it.

4 essays call match-cost. The drawing above is what it returns with no arguments at all; every call below passes it something, because a placement that passes nothing draws whichever member of the family the generator happens to default to rather than the one its essay argues about — which is what optcheck and figfill exist to catch.

Where it is called

Changing this generator changes every one of these figures.

The library, page 3 of 5 — where match-cost sits