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

@ -18,8 +18,8 @@
#include "ef.hpp"
#include "errno.hpp"
#include "fasthash.h"
#include "fs_inode.hpp"
#include "wyhash.h"
#include <string>
@ -61,9 +61,10 @@ path_hash(const char *fusepath_,
const dev_t dev_,
const ino_t ino_)
{
return fasthash64(fusepath_,
fusepath_len_,
fs::inode::MAGIC);
return wyhash(fusepath_,
fusepath_len_,
fs::inode::MAGIC,
_wyp);
}
static
@ -98,9 +99,10 @@ devino_hash(const char *fusepath_,
buf[0] = dev_;
buf[1] = ino_;
return fasthash64((void*)&buf[0],
sizeof(buf),
fs::inode::MAGIC);
return wyhash((void*)&buf[0],
sizeof(buf),
fs::inode::MAGIC,
_wyp);
}
static