leveldb/db
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
..
autocompact_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
builder.cc Merge pull request #819 from wzk784533:master 2020-07-13 19:14:04 +00:00
builder.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
c_test.c unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
c.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
corruption_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
db_impl.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
db_impl.h Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
db_iter.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
db_iter.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
db_test.cc Optimize leveldb block seeks to utilize the current iterator location. 2021-01-11 15:41:38 +00:00
dbformat_test.cc Internal change. 2019-12-02 11:44:39 -08:00
dbformat.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
dbformat.h unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
dumpfile.cc Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
fault_injection_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
filename_test.cc Internal change. 2019-12-02 11:44:39 -08:00
filename.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
filename.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
leveldbutil.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
log_format.h Convert documentation to markdown. 2017-03-01 09:42:25 -08:00
log_reader.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
log_reader.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
log_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
log_writer.cc Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
log_writer.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
memtable.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
memtable.h Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
recovery_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
repair.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
skiplist_test.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
skiplist.h Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
snapshot.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
table_cache.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
table_cache.h Switch from C headers to C++ headers. 2020-04-29 20:51:13 +00:00
version_edit_test.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
version_edit.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
version_edit.h Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
version_set_test.cc Internal change. 2019-12-02 11:44:39 -08:00
version_set.cc Add some std:: qualifiers to types and functions. 2020-04-29 22:33:14 +00:00
version_set.h Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
write_batch_internal.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
write_batch_test.cc Internal change. 2019-12-02 11:44:39 -08:00
write_batch.cc Style cleanup. 2019-05-04 17:42:20 -07:00