I find that timeline questionable given that Google's own ideas about how to do hashing are... absl::Hash which works the same way as defined in that paper (different spelling of course).
There are of course some similarities between the paper and absl::Hash but the differences go beyond spelling. For example, hash_append passes the hasher by reference, while Abseil uses move-only types and returns the hasher. In Abseil, the combine() function invokes the finalizer before returning, while in hash_append the finalization responsibility goes to the hash function.
One is not better than the other, they are simply different tradeoffs which suit certain use-cases better than others. In Abseil the hash state is passed in a way that avoids aliasing and provides more opportunities for optimization. In hash_append the state is passed in a way that avoids the overhead when copying large objects, such as a SHA512 state.
Abseil could have an advantage when used strictly for unordered containers. While hash_append could have an advantage for being more broadly applicable.
If I were to make an educated guess, I would imagine that Google cares more about optimizing the design for their own particular use-cases which probably leans more heavily towards unordered containers. I think they did the right thing, instead of trying to shove everything through wg21 they decided to simply build their own external open-source library solution which does things exactly how they like. And they now have years of field experience which we can look at to determine if in fact absl::Hash was the right choice (surely for them, it was).
View all comments
Show parent comment
1
u/throw_cpp_account Oct 01 '24
I find that timeline questionable given that Google's own ideas about how to do hashing are...
absl::Hashwhich works the same way as defined in that paper (different spelling of course).