Skip to content

Commit 64138b5

Browse files
author
Lei Jin
committed
fix db_bench to use HashSkipList for real
Summary: For HashSkipList case, DBImpl has sanity check to see if prefix_extractor in options is the same as the one in memtable factory. If not, it falls back to SkipList. As result, I was experimenting with SkipList performance. No wonder it is much worse than LinkedList Test Plan: ran benchmark Reviewers: haobo, sdong, igor Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D16569
1 parent 51560ba commit 64138b5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

db/db_bench.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,7 @@ class Benchmark {
10221022
filter_policy_(FLAGS_bloom_bits >= 0
10231023
? NewBloomFilterPolicy(FLAGS_bloom_bits)
10241024
: nullptr),
1025-
prefix_extractor_(NewFixedPrefixTransform(FLAGS_use_plain_table ?
1026-
FLAGS_prefix_size : FLAGS_key_size-1)),
1025+
prefix_extractor_(NewFixedPrefixTransform(FLAGS_prefix_size)),
10271026
db_(nullptr),
10281027
num_(FLAGS_num),
10291028
value_size_(FLAGS_value_size),
@@ -1565,15 +1564,15 @@ class Benchmark {
15651564
switch (FLAGS_rep_factory) {
15661565
case kPrefixHash:
15671566
options.memtable_factory.reset(NewHashSkipListRepFactory(
1568-
NewFixedPrefixTransform(FLAGS_prefix_size),
1567+
prefix_extractor_,
15691568
FLAGS_hash_bucket_count));
15701569
break;
15711570
case kSkipList:
15721571
// no need to do anything
15731572
break;
15741573
case kHashLinkedList:
15751574
options.memtable_factory.reset(NewHashLinkListRepFactory(
1576-
NewFixedPrefixTransform(FLAGS_prefix_size),
1575+
prefix_extractor_,
15771576
FLAGS_hash_bucket_count));
15781577
break;
15791578
case kVectorRep:

0 commit comments

Comments
 (0)