Closed rickyviking closed 2 years ago
A faster implementation of std::hash<uuid>
is now available.
Although probably now needed, the previous one is still available if you define the UUID_HASH_STRING_BASED
macro.
Great, benchmarks with your new implementation are aligned to the ones I reported above.
Hi,
using uuids as keys in stl unordered containers I have noticed a certain performance impact, both in filling and searching. I've come up with the conclusion that this is due to the hash function, which converts the uuids to their string representation and then computes the hash.
Here are some benchmarks I've run for 1'000'000 entries (on i7-7820X 3.6GHz):
As the numbers show, it's much faster both to fill and to search standard containers rather than hash ones, which is counter-intuitive (especially for the search part).
[UPDATE] I've done a quick test replacing the hash algorithm with the simple one used here: updated results below are more in line with what you would expect from a hash container. So is there a specific design implementation behind the string version? Thanks!