Skip to content

Commit

Permalink
DEPS: Update leveldatabase from 1.18 to 1.20.
Browse files Browse the repository at this point in the history
This is a re-land of http://crrev.com/2727693004

This speeds up CRC32C computation from ~900MB/s to ~4GB/s on computers
with modern Intel CPUs. Snappy decompression runs at around 4GB/s, so
CRC32C is a limiting factor when reading large blocks, which can happen
when we store large values.

BUG=

Review-Url: https://codereview.chromium.org/2730703002
Cr-Commit-Position: refs/heads/master@{#454393}
  • Loading branch information
pwnall authored and Commit bot committed Mar 2, 2017
1 parent 9f81209 commit cfb346f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 29 deletions.
17 changes: 1 addition & 16 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -774,22 +774,7 @@ group("gn_only") {
"//third_party/angle:libANGLE",
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
"//third_party/leveldatabase:leveldb_arena_test",
"//third_party/leveldatabase:leveldb_bloom_test",
"//third_party/leveldatabase:leveldb_cache_test",
"//third_party/leveldatabase:leveldb_corruption_test",
"//third_party/leveldatabase:leveldb_crc32c_test",
"//third_party/leveldatabase:leveldb_db_bench",
"//third_party/leveldatabase:leveldb_db_test",
"//third_party/leveldatabase:leveldb_dbformat_test",
"//third_party/leveldatabase:leveldb_env_test",
"//third_party/leveldatabase:leveldb_filename_test",
"//third_party/leveldatabase:leveldb_filter_block_test",
"//third_party/leveldatabase:leveldb_log_test",
"//third_party/leveldatabase:leveldb_skiplist_test",
"//third_party/leveldatabase:leveldb_table_test",
"//third_party/leveldatabase:leveldb_version_edit_test",
"//third_party/leveldatabase:leveldb_write_batch_test",
"//third_party/leveldatabase:leveldb_test_targets",
"//third_party/libjpeg_turbo:simd",
"//third_party/opus:opus_compare",
"//third_party/opus:opus_demo",
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ deps = {
Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + 'dc6e7c25bf47cbfb466e0701fd2728b4a12e79d5',

'src/third_party/leveldatabase/src':
Var('chromium_git') + '/external/leveldb.git' + '@' + 'a7bff697baa062c8f6b8fb760eacf658712b611a',
Var('chromium_git') + '/external/leveldb.git' + '@' + 'a53934a3ae1244679f812d998a4f16f2c7f309a6',

'src/third_party/snappy/src':
Var('chromium_git') + '/external/snappy.git' + '@' + 'f6a298d7c7ddcfdae824649a61408bcf6b334d92',
Expand Down
52 changes: 43 additions & 9 deletions third_party/leveldatabase/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ config("leveldatabase_config") {
]
}

source_set("leveldatabase_opts.sse42") {
sources = [
"src/port/port_posix_sse.cc",
]

configs += [ ":leveldatabase_config" ]

if (target_cpu == "x86" || target_cpu == "x64") {
defines += [ "LEVELDB_PLATFORM_POSIX_SSE" ]
if (!is_win || is_clang) {
cflags = [ "-msse4.2" ]
}
}
}

static_library("leveldatabase") {
sources = [
"env_chromium.cc",
Expand Down Expand Up @@ -108,6 +123,7 @@ static_library("leveldatabase") {
public_configs = [ ":leveldatabase_config" ]

deps = [
":leveldatabase_opts.sse42",
"//base",
"//base/third_party/dynamic_annotations",
"//third_party/re2",
Expand Down Expand Up @@ -188,6 +204,14 @@ if (!is_android) {
deps = [
":leveldb_testutil",
]

# TODO(crbug.com/698013): Fix leveldb to remove the need for suppressing
# warnings.
if (is_win) {
# util\cache_test.cc(167): warning C4018: '<': signed/unsigned mismatch
# util\cache_test.cc(171): warning C4018: '<': signed/unsigned mismatch
cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison.
}
}

test("leveldb_corruption_test") {
Expand Down Expand Up @@ -340,16 +364,26 @@ if (!is_android) {
]
}

test("leveldb_bench") {
sources = [
"src/db/db_bench.cc",
]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]

group("leveldb_test_targets") {
testonly = true
deps = [
":leveldb_testutil",
":env_chromium_unittests",
":leveldb_arena_test",
":leveldb_bloom_test",
":leveldb_cache_test",
":leveldb_corruption_test",
":leveldb_crc32c_test",
":leveldb_db_bench",
":leveldb_db_test",
":leveldb_dbformat_test",
":leveldb_env_test",
":leveldb_filename_test",
":leveldb_filter_block_test",
":leveldb_log_test",
":leveldb_skiplist_test",
":leveldb_table_test",
":leveldb_version_edit_test",
":leveldb_write_batch_test",
]
}
}
2 changes: 1 addition & 1 deletion third_party/leveldatabase/README.chromium
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: LevelDB: A Fast Persistent Key-Value Store
Short Name: leveldb
URL: https://github.com/google/leveldb.git
Version: unknown
Version: 1.20
License: New BSD
License File: src/LICENSE
Security Critical: yes
Expand Down
7 changes: 5 additions & 2 deletions third_party/leveldatabase/port/port_chromium.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
return false;
}

}
}
// Implemented in leveldb's src/port/port_posix_sse.cc.
uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size);

} // namespace port
} // namespace leveldb

#endif // STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_

0 comments on commit cfb346f

Please sign in to comment.