Victor Costan
45ee61579c
Update Travis CI configuration.
* Use Ubuntu 18.04 and LLVM 9 on Travis.
* Fix bash conditionals: [ a == b ] should be [ a = b ].
PiperOrigin-RevId: 271898719
5 роки тому
Sanjay Ghemawat
60db170a43
Fix tsan problem in env_test.
PiperOrigin-RevId: 268265314
5 роки тому
Victor Costan
21304d41f7
Merge pull request #698 from neal-zhu:master
PiperOrigin-RevId: 266001777
5 роки тому
neal-zhu
5e921896ee
drop fileds in State that are duplicates of fileds in Saver and fix typo
5 роки тому
Chris Mumford
53e280b568
Simplify unlocking in DeleteObsoleteFiles.
A recent change (4cb80b7ddc
) to DBImpl::DeleteObsoleteFiles
unlocked DBImpl::mutex_ while deleting files to allow for
greater concurrency. This change improves on the prior in
a few areas:
1. The table is evicted from the table cache before unlocking
the mutex. This should only improve performance.
2. This implementation is slightly simpler, but at the cost of
a bit more memory usage.
3. A comment adding more detail as to why the mutex is being
unlocked and why it is safe to do so.
PiperOrigin-RevId: 253111645
5 роки тому
Chris Mumford
046216a7ca
Add "leveldb" subdirectory to public include paths.
The documentation (README.md and index.md) referred to the
public headers using an incorrect path - fixing.
PiperOrigin-RevId: 252922925
5 роки тому
Chris Mumford
9ee91ac747
Ending sentences with periods in README.md.
This change was submitted in https://github.com/google/leveldb/pull/575
by @prajwalchalla .
This fixes issue #523 .
PiperOrigin-RevId: 252912613
5 роки тому
Victor Costan
e0d5f83a4f
Align EnvPosix and EnvWindows.
Fixes #695 .
PiperOrigin-RevId: 252895299
5 роки тому
Victor Costan
69061b464a
Disable exceptions and RTTI in CMake configuration.
PiperOrigin-RevId: 252842234
5 роки тому
neal-zhu
107a75b62c
cache Saver in State object
5 роки тому
neal-zhu
76ca116276
fix bug(uninitialized options pointer in State)
5 роки тому
neal-zhu
f668239bb2
remove TODO in Version::ForEachOverlapping
5 роки тому
neal-zhu
177cd08629
format
5 роки тому
neal-zhu
8fa7a937ee
fix bug
5 роки тому
neal-zhu
6a90bb91ee
use ForEachOverlapping to impl Get
5 роки тому
Chris Mumford
4cb80b7ddc
Merge pull request #386 from ivanabc:master
PiperOrigin-RevId: 250702492
5 роки тому
Victor Costan
72a38ff7f2
Replace "> >" with ">>"
PiperOrigin-RevId: 250383036
5 роки тому
Victor Costan
863f185970
unsigned char -> uint8_t
PiperOrigin-RevId: 250309603
5 роки тому
Victor Costan
a3b71c1ff6
Use GCC 9 on Travis CI
PiperOrigin-RevId: 249899128
5 роки тому
Chris Mumford
ae49533210
Add explicit typecasts to avoid compiler warning.
Fixes issue #684 .
PiperOrigin-RevId: 249531001
5 роки тому
ivan
63d5315e1c
Merge branch 'master' into master
5 роки тому
Chris Mumford
c00e177f36
Guard DBImpl::versions_ by mutex_.
mutex_ was already acquired before accessing DBImpl::versions_ in all
but one place: DBImpl::GetApproximateSizes. This change requires mutex_
to be held before accessing versions_.
PiperOrigin-RevId: 248390814
5 роки тому
Chris Mumford
1d0b101165
Converted two for-loops to while-loops.
Converted `for (;<condition>;)` to `while (<condition>)`.
PiperOrigin-RevId: 247950510
5 роки тому
Chris Mumford
28e6d238be
Switch to using C++ 11 override specifier.
PiperOrigin-RevId: 247491163
5 роки тому
Chris Mumford
85cd40d108
Added unit test for InternalKey::DecodeFrom with empty string.
PiperOrigin-RevId: 247483339
5 роки тому
Chris Mumford
1aae5c9f29
Merge pull request #411 from proller:assert1
PiperOrigin-RevId: 247424040
5 роки тому
Chris Mumford
b7b86baec9
Using std::ostringstream in key DebugString.
Switching from snprintf to std::ostringstream eliminates
cast warning for (unsigned long long).
PiperOrigin-RevId: 247326681
5 роки тому
Chris Mumford
3e6c000e18
Merge pull request #457 from jellor:patch-2
PiperOrigin-RevId: 247261470
5 роки тому
果冻
1d94fe2f4d
Merge branch 'master' into patch-2
5 роки тому
Victor Costan
27dc99fb26
Fix EnvPosix tests on Travis CI.
The previous attempt of having EnvPosix use O_CLOEXEC (close-on-exec()) when opening file descriptors added tests that relied on procfs, which is Linux-specific. These tests failed on macOS. Unfortunately, the test failures were not caught due to a (since fixed) error in our Travis CI configuration.
This CL re-structures the tests to only rely on POSIX features. Since there is no POSIX-compliant way to get a file name/path out of a file descriptor, this CL breaks up the O_CLOEXEC test into multiple tests, where each Env method that creates an FD gets its own test. This is intended to make it easier to find and fix errors in Env implementations.
This CL also fixes the implementation of NewLogger() to use O_CLOEXEC on macOS. The current implementation passes "we" to fopen(), but the macOS standard C library does not implement the "e" flag yet.
PiperOrigin-RevId: 247088953
5 роки тому
Chris Mumford
9521545b06
Formatting changes for prior O_CLOEXEC fix.
Two minor corrections to correct the 900f7d37eb
commit
to conform to the Google C++ style guide.
PiperOrigin-RevId: 246907647
5 роки тому
Chris Mumford
900f7d37eb
Merge pull request #624 from adam-azarchs:master
PiperOrigin-RevId: 246903086
5 роки тому
Victor Costan
a7528a5d2b
Clean up util/coding.{h,cc}.
1) Inline EncodeFixed{32,64}(). They emit single machine instructions on 64-bit processors.
2) Remove size narrowing compiler warnings from DecodeFixed{32,64}().
3) Add comments explaining the current state of optimizations in compilers we care about.
4) Change C-style includes, like <stdint.h>, to C++ style, like <cstdint>.
5) memcpy -> std::memcpy.
The optimization comments are based on https://godbolt.org/z/RdIqS1 . The missed optimization opportunities in clang have been reported as https://bugs.llvm.org/show_bug.cgi?id=41761
The change does not have significant impact on benchmarks. Results below.
LevelDB: version 1.22
Date: Mon May 6 10:42:18 2019
CPU: 72 * Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz
CPUCache: 25344 KB
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
With change
------------------------------------------------
fillseq : 2.327 micros/op; 47.5 MB/s
fillsync : 4185.526 micros/op; 0.0 MB/s (1000 ops)
fillrandom : 3.662 micros/op; 30.2 MB/s
overwrite : 4.261 micros/op; 26.0 MB/s
readrandom : 4.239 micros/op; (1000000 of 1000000 found)
readrandom : 3.649 micros/op; (1000000 of 1000000 found)
readseq : 0.174 micros/op; 636.7 MB/s
readreverse : 0.271 micros/op; 408.7 MB/s
compact : 570495.000 micros/op;
readrandom : 2.735 micros/op; (1000000 of 1000000 found)
readseq : 0.118 micros/op; 937.3 MB/s
readreverse : 0.190 micros/op; 583.7 MB/s
fill100K : 860.164 micros/op; 110.9 MB/s (1000 ops)
crc32c : 1.131 micros/op; 3455.2 MB/s (4K per op)
snappycomp : 3.034 micros/op; 1287.5 MB/s (output: 55.1%)
snappyuncomp : 0.544 micros/op; 7176.0 MB/s
Baseline
------------------------------------------------
fillseq : 2.365 micros/op; 46.8 MB/s
fillsync : 4240.165 micros/op; 0.0 MB/s (1000 ops)
fillrandom : 3.244 micros/op; 34.1 MB/s
overwrite : 4.153 micros/op; 26.6 MB/s
readrandom : 4.698 micros/op; (1000000 of 1000000 found)
readrandom : 4.065 micros/op; (1000000 of 1000000 found)
readseq : 0.192 micros/op; 576.3 MB/s
readreverse : 0.286 micros/op; 386.7 MB/s
compact : 635979.000 micros/op;
readrandom : 3.264 micros/op; (1000000 of 1000000 found)
readseq : 0.169 micros/op; 652.8 MB/s
readreverse : 0.213 micros/op; 519.5 MB/s
fill100K : 1055.367 micros/op; 90.4 MB/s (1000 ops)
crc32c : 1.353 micros/op; 2887.3 MB/s (4K per op)
snappycomp : 3.036 micros/op; 1286.7 MB/s (output: 55.1%)
snappyuncomp : 0.540 micros/op; 7238.6 MB/s
PiperOrigin-RevId: 246856811
5 роки тому
Chris Mumford
142035edd4
Initialize Stats::start_ before first use in Stats::Start().
Avoids a use before initialization error. This fixes issue #676 .
PiperOrigin-RevId: 246855204
5 роки тому
Victor Costan
e22b1cec6e
Merge pull request #365 from allangj:c-strict-prototypes
PiperOrigin-RevId: 246848402
5 роки тому
allangj
cd1ec032cd
Add argument definition for void c functions.
Allow the use c.h on projects with -Wstrict-prototypes
Modify CMakelist to include -Wstrict-prototypes
8 роки тому
Victor Costan
4bd052d7e8
Consolidate benchmark code to benchmarks/.
Currently, the benchmark used to assess leveldb changes lives in db/. The codebase also contains two benchmarks against other database engines in doc/bench/. Moving all the benchmarks in one place opens up the way for extracting common code.
PiperOrigin-RevId: 246737541
5 роки тому
Victor Costan
506b1722ef
Convert missed virtual -> override in db_test.cc.
PiperOrigin-RevId: 246680419
5 роки тому
Victor Costan
24424a1ef2
Style cleanup.
1) Convert iterator-based for loops to C++11 foreach loops.
2) Convert "void operator=" to "T& operator=".
3) Switch from copy operators from private to public deleted.
4) Switch from empty ctors / dtors to "= default" where appropriate.
PiperOrigin-RevId: 246679195
5 роки тому
Victor Costan
9a56c49ed4
Merge pull request #679 from smartxworks:optimize-readseq
PiperOrigin-RevId: 246668103
5 роки тому
Victor Costan
abf441b657
Merge pull request #278 from wankai:master
PiperOrigin-RevId: 246591372
5 роки тому
Chris Mumford
78b39d68c1
Bump the version number from 1.21 to 1.22.
PiperOrigin-RevId: 246558281
5 роки тому
Chris Mumford
9bd23c7676
Correct class/structure declaration order.
1. Correct the class/struct declaration order to be IAW
the Google C++ style guide[1].
2. For non-copyable classes, switched from non-implemented
private methods to explicitly deleted[2] methods.
3. Minor const and member initialization fixes.
[1] https://google.github.io/styleguide/cppguide.html#Declaration_Order
[2] http://eel.is/c++draft/dcl.fct.def.delete
PiperOrigin-RevId: 246521844
5 роки тому
Chris Mumford
c784d63b93
Moved port/README to port/README.md.
Easier to read on sites supporting Markdown (i.e. GitHub).
PiperOrigin-RevId: 246385089
5 роки тому
Chris Mumford
297e66afc1
Format all files IAW the Google C++ Style Guide.
Use clang-format to correct formatting to be in agreement with the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html ). Doing this simplifies the process of accepting changes. Also fixed a few warnings flagged by clang-tidy.
PiperOrigin-RevId: 246350737
5 роки тому
Victor Costan
3724030179
Update Travis CI configuration.
The Travis configuration:
1) Installs recent versions of clang and GCC.
2) Sets up the environment so that CMake picks up the installed
compilers. Previously, the pre-installed clang compiler was used
instead.
3) Requests a modern macOS image that has all the headers needed by GCC.
The CL also removes now-unnecessary old workarounds from the
Travis configuration.
PiperOrigin-RevId: 245831188
5 роки тому
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>
5 роки тому
leveldb Team
3dc9202f78
[leveldb] Specifically export the WriteBatch::Handler inner class for Windows link
Windows linking visibility in shared libraries requires that inner classes are
specifically exported as visible, even if the containing class is exported.
PiperOrigin-RevId: 244886019
5 роки тому
Chris Mumford
2ccb45c33a
Check for possibly invalid offset in test.
Fix a possible array bounds offset issue flagged in
issue #668 . Not the source of any known bug, but will
silence any static analyzers.
PiperOrigin-RevId: 243697659
5 роки тому
Chris Mumford
7b11745190
Changed Windows specific highlighting from bash to cmd.
This makes the syntax highlighting a little nicer on GitHub.
PiperOrigin-RevId: 243426806
5 роки тому