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
main
Lei Jin 11 years ago
parent 51560ba755
commit 64138b5d9c
  1. 7
      db/db_bench.cc

@ -1022,8 +1022,7 @@ class Benchmark {
filter_policy_(FLAGS_bloom_bits >= 0 filter_policy_(FLAGS_bloom_bits >= 0
? NewBloomFilterPolicy(FLAGS_bloom_bits) ? NewBloomFilterPolicy(FLAGS_bloom_bits)
: nullptr), : nullptr),
prefix_extractor_(NewFixedPrefixTransform(FLAGS_use_plain_table ? prefix_extractor_(NewFixedPrefixTransform(FLAGS_prefix_size)),
FLAGS_prefix_size : FLAGS_key_size-1)),
db_(nullptr), db_(nullptr),
num_(FLAGS_num), num_(FLAGS_num),
value_size_(FLAGS_value_size), value_size_(FLAGS_value_size),
@ -1565,7 +1564,7 @@ class Benchmark {
switch (FLAGS_rep_factory) { switch (FLAGS_rep_factory) {
case kPrefixHash: case kPrefixHash:
options.memtable_factory.reset(NewHashSkipListRepFactory( options.memtable_factory.reset(NewHashSkipListRepFactory(
NewFixedPrefixTransform(FLAGS_prefix_size), prefix_extractor_,
FLAGS_hash_bucket_count)); FLAGS_hash_bucket_count));
break; break;
case kSkipList: case kSkipList:
@ -1573,7 +1572,7 @@ class Benchmark {
break; break;
case kHashLinkedList: case kHashLinkedList:
options.memtable_factory.reset(NewHashLinkListRepFactory( options.memtable_factory.reset(NewHashLinkListRepFactory(
NewFixedPrefixTransform(FLAGS_prefix_size), prefix_extractor_,
FLAGS_hash_bucket_count)); FLAGS_hash_bucket_count));
break; break;
case kVectorRep: case kVectorRep:

Loading…
Cancel
Save