leveldb/table
leveldb Team 8cce47e450 Optimize leveldb block seeks to utilize the current iterator location.
This is beneficial when iterators are reused and seeks are not random
but increasing. It is additionally beneficial with larger block sizes and keys with common prefixes.

Add a benchmark "seekordered" to db_bench that reuses iterators across
increasing seeks.  Add support to the benchmark to count comparisons made and to support common key prefix length. Change benchmark random seeds to be reproducible for entire benchmark suite executions but unique for threads in different benchmarks runs.  This changes a benchmark suite of readrandom,seekrandom from having a 100% found ratio as previously it had the same seed used for fillrandom.

./db_bench --benchmarks=fillrandom,compact,seekordered --block_size=262144 --comparisons=1 --key_prefix=100

without this change (though with benchmark changes):
seekrandom   :      55.309 micros/op; (631820 of 1000000 found)
Comparisons: 27001049
seekordered  :       1.732 micros/op; (631882 of 1000000 found)
Comparisons: 26998402

with this change:
seekrandom   :      55.866 micros/op; (631820 of 1000000 found)
Comparisons: 26952143
seekordered  :       1.686 micros/op; (631882 of 1000000 found)
Comparisons: 25549369

For ordered seeking, this is a reduction of 5% comparisons and a 3% speedup. For random seeking (with single use iterators) the comparisons and speed are less than 1% and likely noise.

PiperOrigin-RevId: 351149832
2021-01-11 15:41:38 +00:00
..
block_builder.cc Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
block_builder.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
block.cc Optimize leveldb block seeks to utilize the current iterator location. 2021-01-11 15:41:38 +00:00
block.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
filter_block_test.cc Internal change. 2019-12-02 11:44:39 -08:00
filter_block.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
filter_block.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
format.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
format.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
iterator_wrapper.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
iterator.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
merger.cc Switch to using C++ 11 override specifier. 2019-05-09 14:11:06 -07:00
merger.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
table_builder.cc Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
table_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
table.cc remove unnessary status judge 2020-04-24 02:00:12 +00:00
two_level_iterator.cc Switch to using C++ 11 override specifier. 2019-05-09 14:11:06 -07:00
two_level_iterator.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00