| N | searches (10N) | total compares | per search | ratio |
|---|---|---|---|---|
| Press “Run doubling test”. | ||||
Everything here runs live in your browser: the whitelist in panels 2 and 3 is generated fresh each run, the same way Sedgewick's Generator does it, and every compare is actually executed and counted. In panel 1, == never matches because in Java two strings read at runtime are different objects, even when they hold the same characters.