mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-12 05:40:04 +00:00
Common: Replace MurmurHash3 with CityHash64
CityHash64 is faster than Murmur3 at all sizes, but especially for short keys.
This commit is contained in:
parent
79dca3d67a
commit
7f77820460
5 changed files with 766 additions and 147 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue