1
0
mirror of https://github.com/google/leveldb.git synced 2025-04-25 14:00:27 +08:00

kBranching 16 is better than 4 in db benchmarks

This commit is contained in:
MagnetoWang 2020-03-28 21:34:20 +08:00
parent 5903e7a112
commit d0254fd8ae

View File

@ -241,7 +241,7 @@ inline void SkipList<Key, Comparator>::Iterator::SeekToLast() {
template <typename Key, class Comparator>
int SkipList<Key, Comparator>::RandomHeight() {
// Increase height with probability 1 in kBranching
static const unsigned int kBranching = 4;
static const unsigned int kBranching = 16;
int height = 1;
while (height < kMaxHeight && ((rnd_.Next() % kBranching) == 0)) {
height++;