09b6bf828a
Summary: Summary ======== `InlineSkipList<>::Insert` takes the `key` parameter as a C-string. Then, it performs multiple comparisons with it requiring the `GetLengthPrefixedSlice()` to be spawn in `MemTable::KeyComparator::operator()(const char* prefix_len_key1, const char* prefix_len_key2)` on the same data over and over. The patch tries to optimize that. Rough performance comparison ===== Big keys, no compression. ``` $ ./db_bench --writes 20000000 --benchmarks="fillrandom" --compression_type none -key_size 256 (...) fillrandom : 4.222 micros/op 236836 ops/sec; 80.4 MB/s ``` ``` $ ./db_bench --writes 20000000 --benchmarks="fillrandom" --compression_type none -key_size 256 (...) fillrandom : 4.064 micros/op 246059 ops/sec; 83.5 MB/s ``` TODO ====== In ~~a separated~~ this PR: - [x] Go outside the write path. Maybe even eradicate the C-string-taking variant of `KeyIsAfterNode` entirely. - [x] Try to cache the transformations applied by `KeyComparator` & friends in situations where we havy many comparisons with the same key. Closes https://github.com/facebook/rocksdb/pull/3516 Differential Revision: D7059300 Pulled By: ajkr fbshipit-source-id: 6f027dbb619a488129f79f79b5f7dbe566fb2dbb |
||
---|---|---|
.. | ||
alloc_tracker.cc | ||
hash_cuckoo_rep.cc | ||
hash_cuckoo_rep.h | ||
hash_linklist_rep.cc | ||
hash_linklist_rep.h | ||
hash_skiplist_rep.cc | ||
hash_skiplist_rep.h | ||
inlineskiplist_test.cc | ||
inlineskiplist.h | ||
memtablerep_bench.cc | ||
skiplist_test.cc | ||
skiplist.h | ||
skiplistrep.cc | ||
stl_wrappers.h | ||
vectorrep.cc | ||
write_buffer_manager_test.cc | ||
write_buffer_manager.cc |