Billion-query-per-second lookup tables in C++
0 comments · c++, programming
- Comments7
0 comments · c++, programming
Story details from Lobsters ↗ · linked article on lemire.me.
Billion-query-per-second lookup tables in C++ was first seen on Lobsters · Hottest on Oct 28, 2026. Since then it has appeared in 58 checks on 3 different days. Its best position was #8 of 25, reached on Oct 28, 16:19 UTC. It dropped off the list after Oct 31, 11:51 UTC. The same link also trended on Hacker News, which raises its cross-platform score.
Position on Lobsters · Hottest at every check (lower is better).
Best rank per day (UTC).
Platform metric as reported by Lobsters.
| List | Best | Days | Checks | Last seen |
|---|---|---|---|---|
| Lobsters · Hottest | #8 | 3 | 58 | |
| YHacker News · Front page Billion-query-per-second lookup tables in C++ | same link | |||
A few top-level comments from Lobsters, shortened. Read the full thread on Lobsters.
For the article's key set {"GET", "POST", "PUT", "DELETE", "PATCH"} you can use the perfect hash function (0x13340001u * (n ^ s[0])) >> 29 into {0, 1, ..., 7}, assuming the length n is provided with s and s[n] is 0 (so that unconditionally indexing s[0] gives a well-defined value). That's 5 cycles of latency on…
> Reading past the end of a buffer is fine as long as you do not cross into another memory page, and pages are at least 4 kilobytes. No, reading past the end of a buffer is UB no matter what.
It's fine at the level of the concrete machine (if you know the architecture and take precautions like avoiding page crossings), not the abstract machine. In practice that means you have to do it with inline (or out-of-line) assembly to avoid UB, which is how you implement a fast strlen. But to your point and what…
Archived daily, weekly and monthly lists that include this entry.
Not at the moment. It was last on the list on Oct 31, 11:51 UTC, after 3 days of trending.
#8 on Lobsters · Hottest, on Oct 28, 16:19 UTC. Trendoday checks this list every 30 minutes.
It was first seen on Oct 28, 2026 and has been on the list on 3 days (58 checks) since.