On 2014-12-24 13:58:41 -0600, Jim Nasby wrote: > This surprises me given that SMHasher shows XXH to be 50% faster than Spooky > for 20 byte keys.
Note that there's quite some differences in how smhasher and postgres use the hash functions. The former nearly exclusively exercises the hash function while postgres also executes a lot of other code. Which means that the instruction cache and branch prediction is much less likely to contain relevant entries. And that can change the performance characteristics noticeably. Additionally there's differences in how much pipelining can be employed - the likelihood the CPU is able to do so in tight loops is much higher. Also note that in many cases in which you can see tag_hash/hash_any in workloads a part of the cost won't actually be the computation of the hashes themselves but the cache misses triggered by the hash computation accessing the data. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers