Billion-query-per-second lookup tables in C++

(lemire.me)

15 points | by foltik a day ago ago

2 comments

  • Panzerschrek 20 hours ago ago

    Nice approach. I hope some time compilers will eventually learn to detect code containing a bunch of if-else with string comparison and replace it with perfect hashing.

  • Panzerschrek 17 hours ago ago

    > How do we find the association values? We sort the characters by how many keys they touch. We then take them one at a time and try 0, 1, 2, … until we find a value that does not cause a collision.

    This sounds too easy to be true. As I understand, that's the core of the whole approach - to find a table filled with some magic values giving perfect hashing. And it shouldn't be that simple, since search space is huge (a table with 256-values each with 8 bits size at least).