-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve metadata speed for big directories #272
base: dev
Are you sure you want to change the base?
Conversation
abb1e6c
to
0ee4fab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good improvement !! Just few comments/doubts below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP review, some of my comments apply to #268
0ee4fab
to
568ae81
Compare
568ae81
to
b104bff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP review 2/3
b104bff
to
f6b6cf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good to me.
f6b6cf0
to
fdacc58
Compare
This commit changes the old flat_map that was advised to use for an ordered_statistics structure that ensures good performance in every case. The custom flat_map structure previously used had O(n) insertion and elimination costs, the new one has O(logn) cost for both of those operations. The goal of this change is to speedup the metadata operations for directories with lots of files. Signed-off-by: Dave <dave@leil.io>
fdacc58
to
5280a71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @dmga44 👍 🔥 💪
typedef flat_map<hstorage::Handle *, FSNode *, | ||
std::vector<std::pair<hstorage::Handle *, FSNode *>>, | ||
HandleCompare> | ||
typedef __gnu_pbds::tree<std::pair<hstorage::Handle *, FSNode *>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider to use modern C++ using
instruction instead of typedef
in the definition of EntriesContainer
.
Consider also to apply the same change in the current definition of iterator
and const_iterator
that also use typedef
.
[Must be merged after #268 ]
This commit changes the old flat_map that was advised to use for an
ordered_statistics structure that ensures good performance in every
case. The custom flat_map structure previously used had O(n) insertion
and elimination costs, the new one has O(logn) cost for both of those
operations. The goal of this change is to speedup the metadata
operations for directories with lots of files.