mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-02 12:57:12 -05:00
change from fasthash64 to wyhash
wyhash has very good performance for small keys (our usecase) and works on platforms with alignment concerns. A user had an issue where fasthash64 lead to misaligned reads and signal exceptions. wyhash does not have such issues and is faster.
This commit is contained in:
parent
58a8f8326d
commit
0371b047f9
5 changed files with 151 additions and 149 deletions
|
|
@ -19,7 +19,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "khash.h"
|
||||
#include "fasthash.h"
|
||||
#include "wyhash.h"
|
||||
|
||||
KHASH_SET_INIT_INT64(hashset);
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public:
|
|||
uint64_t h;
|
||||
khint_t key;
|
||||
|
||||
h = fasthash64(str_,len_,0x7472617065786974);
|
||||
h = wyhash(str_,len_,0x7472617065786974,_wyp);
|
||||
|
||||
key = kh_put(hashset,_set,h,&rv);
|
||||
if(rv == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue