8cce47e450
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 |
||
---|---|---|
.. | ||
autocompact_test.cc | ||
builder.cc | ||
builder.h | ||
c_test.c | ||
c.cc | ||
corruption_test.cc | ||
db_impl.cc | ||
db_impl.h | ||
db_iter.cc | ||
db_iter.h | ||
db_test.cc | ||
dbformat_test.cc | ||
dbformat.cc | ||
dbformat.h | ||
dumpfile.cc | ||
fault_injection_test.cc | ||
filename_test.cc | ||
filename.cc | ||
filename.h | ||
leveldbutil.cc | ||
log_format.h | ||
log_reader.cc | ||
log_reader.h | ||
log_test.cc | ||
log_writer.cc | ||
log_writer.h | ||
memtable.cc | ||
memtable.h | ||
recovery_test.cc | ||
repair.cc | ||
skiplist_test.cc | ||
skiplist.h | ||
snapshot.h | ||
table_cache.cc | ||
table_cache.h | ||
version_edit_test.cc | ||
version_edit.cc | ||
version_edit.h | ||
version_set_test.cc | ||
version_set.cc | ||
version_set.h | ||
write_batch_internal.h | ||
write_batch_test.cc | ||
write_batch.cc |