optimize readdir file dedup

Use fasthash64 to hash filenames to uint64_t and store in khash
set. Significantly reduces malloc/free'ing and memory usage.
This commit is contained in:
Antonio SJ Musumeci 2018-10-16 16:20:32 -04:00
parent b8b3ab06a7
commit 3631ab7df2
5 changed files with 192 additions and 48 deletions

View file

@ -19,7 +19,6 @@
#include <fuse.h>
#include <string>
#include <set>
#include <vector>
#include "config.hpp"
@ -33,9 +32,9 @@
#include "fs_devid.hpp"
#include "fs_inode.hpp"
#include "fs_path.hpp"
#include "hashset.hpp"
#include "readdir.hpp"
#include "rwlock.hpp"
#include "strset.hpp"
#include "ugid.hpp"
using std::string;
@ -50,7 +49,7 @@ _readdir(const Branches &branches_,
void *buf,
const fuse_fill_dir_t filler)
{
StrSet names;
HashSet names;
string basepath;
struct stat st = {0};