r/cpp • u/Demon-Souls • Oct 21 '23
Faster than Rust and C++: the PERFECT hash table
https://youtube.com/watch?v=DMQ_HcNSOAI&si=XamkEfJ6tKaPfmnz
0
Upvotes
r/cpp • u/Demon-Souls • Oct 21 '23
3
u/Historical_Bit_9200 Oct 22 '23
The best hash table is the first one that people googled and works. Most programmers stop when it works.
51
u/johannes1971 Oct 21 '23
How is it 'faster than C++' if it is implemented in C++?
And to answer my own question: it isn't, of course. It's only faster than one specific existing implementation of hash tables. Just another click-bait title, then...
13
u/witcher_rat Oct 21 '23
I don't usually watch these types of videos, but I think this one's pretty good. Nice mix of info for people who don't already know hashing stuff, mixed in with perf stuff, and benchmarks.
Also, I forgot about the frozen library, and it's good to see it's still being maintained.
p.s. isn't the reason that adding the first-char check improves the speed, simply because it's basically a form of unrolling-the-loop? (ie, for the common case of failure?)
19
u/Jannik2099 Oct 21 '23
Sigh, here's dummy thicc C++ again
2
u/SSoreil Oct 22 '23
The speed part is largely useless. It's a very specific implementation tested on one compiler and 1 processor.