A new hash table for Lwan

Coder ditches old system, internet turns a nerdy upgrade into a philosophy fight

TLDR: Lwan’s developer threw out an old, increasingly messy data-storage system and replaced it with a cleaner, faster design inspired by modern tools. The community reaction was peak nerd drama: part awe-filled lesson, part joking disbelief that a hash table could spark this much passion.

A humble behind-the-scenes software upgrade somehow turned into comment-section theater. The developer behind Lwan, a web server project, basically confessed that the old way of organizing data had become a patched-up mess: it started as a borrowed design, got tweaked for years, and eventually turned into technical debt with real failures. So he scrapped it and built a new approach inspired by ideas used in Rust, Google, and even Go. In plain English: he replaced an aging filing system with a faster, cleaner one that works across more kinds of computers.

But the real fireworks came from the crowd. Instead of just arguing about speed, people got almost spiritual about hash tables. The standout reaction came from momojo, who treated the topic like a life-changing moment in computer science: the kind of concept that suddenly makes the whole field click. That set the tone for a very classic internet split: one camp saw the post as a beautiful lesson in elegant engineering, while the other could practically be heard groaning, "We’re really doing discourse over a data container now?"

And yes, there was humor in the absurdity. The vibe was half master class, half meme: people joking that programmers can turn anything into a holy war, including the digital equivalent of labeled drawers. The hottest take wasn’t even "is it faster?" — it was that a boring-sounding storage trick can unlock a whole new level of understanding. Only on the internet could a hash table rollout feel like a dramatic season finale.

Key Points

  • Lwan replaced an older, heavily modified kmod-derived hash table after inefficiency and technical debt caused problems.
  • The new implementation was influenced by Rust’s hashbrown and, indirectly, Abseil’s SwissTable.
  • The article explains SwissTable’s use of grouped layouts, control bytes, split hashes, and SIMD-assisted probing.
  • Direct SIMD was rejected in Lwan’s implementation because of portability concerns, and SWAR was only considered as an alternative.
  • Lwan’s new table uses a single-group structure and relies on memchr() to search tophash values before verifying keys.

Hottest takes

"miraculous data structures" — momojo
"once grokked, take you up a step-function" — momojo
"Just solve everything in a hash table" — momojo
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.