Common: Replace MurmurHash3 with CityHash64
CityHash64 is faster than Murmur3 at all sizes, but especially for short keys.
This commit is contained in:
@@ -5,12 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include "common/cityhash.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
void MurmurHash3_128(const void* key, size_t len, u32 seed, void* out);
|
||||
|
||||
/**
|
||||
* Computes a 64-bit hash over the specified block of data
|
||||
* @param data Block of data to compute hash over
|
||||
@@ -18,9 +17,7 @@ void MurmurHash3_128(const void* key, size_t len, u32 seed, void* out);
|
||||
* @returns 64-bit hash value that was computed over the data block
|
||||
*/
|
||||
static inline u64 ComputeHash64(const void* data, size_t len) {
|
||||
u64 res[2];
|
||||
MurmurHash3_128(data, len, 0, res);
|
||||
return res[0];
|
||||
return CityHash64(static_cast<const char*>(data), len);
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
Reference in New Issue
Block a user