11 nanoseconds per word: Ridiculously Over-Optimizing Anagrams | Wiredream - Dave Andersen's blog
Not investment advice. Muhabbit scores how much a story may matter, not which way to trade.
David G. Andersen released a Rust-based anagram solver that indexes all 178,690 entries in the Scrabble dictionary in 31 milliseconds, or 173 nanoseconds per word, after building a collision-free prime-product identifier that fits every dictionary word into a single 64-bit integer. The solver targets a new Word Ladder variant in which players mutate words by single-letter changes, additions, deletions, or anagramming, and the anagram index is a stepping stone to a full ladder solver promised in a follow-up post. Andersen cut the baseline cost by eliminating the per-word Vec allocations that dominated the original hash-table build, which produced roughly 161,019 distinct anagram keys. The work matters as a case study in how allocation overhead, not algorithmic complexity, drives cost in dictionary-scale string processing, and the prime-product trick offers a compact alternative to letter-sorted or letter-count keys. Watch for the next post, where the anagram index feeds the complete word-ladder search.
Muhabbit's AI wrote this summary in its own words from Hacker News's report. It can get details wrong, so check the source.
Named in this story
David G. Andersen, Rust, Knuth