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:
Antonio SJ Musumeci 2020-08-06 18:40:36 -04:00
parent 58a8f8326d
commit 0371b047f9
5 changed files with 151 additions and 149 deletions

View file

@ -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)