4 ms·
How does it compare to xxHash? https://github.com/Cyan4973/xxHash https://github.com/Cyan4973/xxHash Comparing MetroHash to CityHash is not really fair. Why wo
by jedisct1 11y ago
How does it compare to xxHash? https://github.com/Cyan4973/xxHash https://github.com/Cyan4973/xxHash
Comparing MetroHash to CityHash is not really fair. Why would anyone use CityHash in 2015?
- gojomo 11y agoIt looks like 'FarmHash' is the successor from the CityHash authors. Does xxHash have 128/256-bit variants?
- jandrewrogers 11y agoWith respect to xxHash64, the closest (and slowest) algorithm is Metro64. I just ran it on my laptop using SMHasher for comparison purposes. - Metro64 is about 10-15% faster for bulk hashing - Metro64 is about 2x faster for small keys - Metro64 has better statistical quality These days, most people should be using 128-bit hash functions. Not only are they more collision resistant, they also run faster on modern microarchitectures. Measuring CityHash at 32-bits is not a realistic measurement of its performance. Its structure is optimized for 64-128 bit hashes, which it actually does quite well for some types of keys.
- rurban 11y agoMost is true, but: 128-bit hash functions for hash table makes no sense, unless you have 1TB tables in external memory. And for security 128 is peanuts, you start with 256 there. First you need 4x more space, when you store the hash also for faster collision checks. 32bit is normal. cache size is more important than cpu mostly. Second, collision resistancy on normal sized hash tables take only the first 7-15 bits, so calculating the other 113 bits makes not much sense. 32 bit is usually enough unless you need huge tables, where 64bit is enough.
- cbsmith 11y agoI do it all the time. CityHash has been around long enough that it is broadly included in most hash suites on most platforms, but is new enough that it doesn't suck as bad as its predecessors.
- rurban 11y agoMy smhasher fork has both: https://github.com/rurban/smhasher/ https://github.com/rurban/smhasher/ Comparable results for xxHash and the new metrohash will be uploaded soon. These things take time. But I'm more interested in comparing it to HW CRC32-C, the fastest and best hash so far, 2x faster than metro.
- gpakosz 11y agoFor the record, CRC32-C doesn't appear in your summary table