Slightly modify kvdk_engine_unsorted to improve performance, also fix some compiler warning. #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed
<filesystem>
header.2.1.
pmem_segment_blocks
determines the maximum size of a key-value pair. Setting the parameter to 1024 allows the engine to store key-value pair of maximum size of approximately 64KB.2.2.
hash_bucket_num
is a critical parameter for performance tuning. KVDK engine currently does not support rehashing. With the load factor increasing, time for looking up a key will increase linearly accordingly. Load factor can be estimated bykv-pairs/(hash_bucket_num*7)
. Load factor 0.7 is suggested for best performance and DRAM utilization. In other words, it's recommended to set hash_bucket_num tokv-pairs/5
. A larger parameter will not improve performance much, but will cost more DRAM.