leveldb/db
Kyle Zhang d3d1c8a0f4 don't check current key in DBIter::Next()
When iter_ is pointing to current key, we can safely move to the next
key to avoid checking current key, which is of course not necessary.

Benchmark shows that 'readseq' has about 8% performance improvement.

Without patch:

>./db_bench --benchmarks=readseq --num=$((4<<20)) --db=/tmp/db --use_existing_db=1
LevelDB:    version 1.21
Date:       Thu Apr 25 09:37:21 2019
CPU:        32 * Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
CPUCache:   20480 KB
Keys:       16 bytes each
Values:     100 bytes each (50 bytes after compression)
Entries:    4194304
RawSize:    464.0 MB (estimated)
FileSize:   264.0 MB (estimated)
------------------------------------------------
readseq      :       0.196 micros/op;  565.7 MB/s

With patch:

>./db_bench --benchmarks=readseq --num=$((4<<20)) --db=/tmp/db --use_existing_db=1
LevelDB:    version 1.21
Date:       Thu Apr 25 09:38:20 2019
CPU:        32 * Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
CPUCache:   20480 KB
Keys:       16 bytes each
Values:     100 bytes each (50 bytes after compression)
Entries:    4194304
RawSize:    464.0 MB (estimated)
FileSize:   264.0 MB (estimated)
------------------------------------------------
readseq      :       0.181 micros/op;  612.3 MB/s

Signed-off-by: Kyle Zhang <kyle@smartx.com>
2019-04-25 09:54:05 +08:00
..
autocompact_test.cc LevelDB 1.13 2013-08-21 11:12:47 -07:00
builder.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
builder.h Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
c_test.c Expose WriteBatch::Append in the C API. 2018-08-19 19:54:34 -07:00
c.cc Expose WriteBatch::Append in the C API. 2018-08-19 19:54:34 -07:00
corruption_test.cc Switch corruption_test to use InMemEnv. 2019-03-20 13:57:03 -07:00
db_bench.cc Initialize class members to default values in constructors. 2019-04-12 18:50:15 -07:00
db_impl.cc Initialize class members to default values in constructors. 2019-04-12 18:50:15 -07:00
db_impl.h leveldb: Replace AtomicPointer with std::atomic. 2019-03-11 13:41:25 -07:00
db_iter.cc don't check current key in DBIter::Next() 2019-04-25 09:54:05 +08:00
db_iter.h Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
db_test.cc leveldb: Add tests for empty keys and values. 2019-03-29 11:22:22 -07:00
dbformat_test.cc A number of fixes: 2011-10-31 17:22:06 +00:00
dbformat.cc Release leveldb 1.10 2013-05-14 17:03:07 -07:00
dbformat.h Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
dumpfile.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
fault_injection_test.cc Inline defaults in options. 2019-03-20 13:56:22 -07:00
filename_test.cc Add tests for {Old}InfoLogFileName(). 2018-03-12 09:24:25 -07:00
filename.cc Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
filename.h Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
leveldbutil.cc Putting build artifacts in subdirectory. 2016-01-29 16:10:00 -08:00
log_format.h Convert documentation to markdown. 2017-03-01 09:42:25 -08:00
log_reader.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
log_reader.h Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
log_test.cc This CL fixes a bug encountered when reading records from leveldb files that have been split, as in a [] input task split. 2016-03-31 15:53:34 -07:00
log_writer.cc LevelDB now attempts to reuse the preceding MANIFEST and log file when re-opened. 2015-08-11 14:56:39 -07:00
log_writer.h LevelDB now attempts to reuse the preceding MANIFEST and log file when re-opened. 2015-08-11 14:56:39 -07:00
memtable.cc Fix sign mismatch warnings in GCC. 2018-04-16 18:13:09 -07:00
memtable.h Extend thread safety annotations. 2018-03-16 10:32:40 -07:00
recovery_test.cc Added native support for Windows. 2019-03-01 18:00:35 -08:00
repair.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
skiplist_test.cc fix a typo in the comment of skiplist_test.cc (#664) 2019-03-21 07:58:29 -07:00
skiplist.h leveldb: Replace AtomicPointer with std::atomic. 2019-03-11 13:41:25 -07:00
snapshot.h Clean up SnapshotImpl. 2018-04-30 16:01:39 -07:00
table_cache.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
table_cache.h Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
version_edit_test.cc A number of fixes: 2011-10-31 17:22:06 +00:00
version_edit.cc Replace NULL with nullptr in C++ files. 2018-04-10 16:26:43 -07:00
version_edit.h A number of fixes: 2011-10-31 17:22:06 +00:00
version_set_test.cc Fix formatting of recent snapshot compaction fix. 2019-04-12 00:17:03 -07:00
version_set.cc Fix formatting of recent snapshot compaction fix. 2019-04-12 00:17:03 -07:00
version_set.h Fixed typo in comment in version_set.h. 2019-04-12 00:16:41 -07:00
write_batch_internal.h Clean up layering of storage/leveldb/... 2014-12-11 08:02:45 -08:00
write_batch_test.cc Expose WriteBatch::Append(). 2018-08-14 15:30:29 -07:00
write_batch.cc leveldb: Make WriteBatch::ApproximateSize() const. 2019-01-15 18:43:13 +00:00