From 64138b5d9cae2990aa46157da97cdf1656c1a046 Mon Sep 17 00:00:00 2001 From: Lei Jin Date: Wed, 5 Mar 2014 10:28:53 -0800 Subject: [PATCH] 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 --- db/db_bench.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/db/db_bench.cc b/db/db_bench.cc index 1a050a48d..085039cc5 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -1022,8 +1022,7 @@ class Benchmark { filter_policy_(FLAGS_bloom_bits >= 0 ? NewBloomFilterPolicy(FLAGS_bloom_bits) : nullptr), - prefix_extractor_(NewFixedPrefixTransform(FLAGS_use_plain_table ? - FLAGS_prefix_size : FLAGS_key_size-1)), + prefix_extractor_(NewFixedPrefixTransform(FLAGS_prefix_size)), db_(nullptr), num_(FLAGS_num), value_size_(FLAGS_value_size), @@ -1565,7 +1564,7 @@ class Benchmark { switch (FLAGS_rep_factory) { case kPrefixHash: options.memtable_factory.reset(NewHashSkipListRepFactory( - NewFixedPrefixTransform(FLAGS_prefix_size), + prefix_extractor_, FLAGS_hash_bucket_count)); break; case kSkipList: @@ -1573,7 +1572,7 @@ class Benchmark { break; case kHashLinkedList: options.memtable_factory.reset(NewHashLinkListRepFactory( - NewFixedPrefixTransform(FLAGS_prefix_size), + prefix_extractor_, FLAGS_hash_bucket_count)); break; case kVectorRep: