mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
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:
parent
b8b3ab06a7
commit
3631ab7df2
5 changed files with 192 additions and 48 deletions
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue