From 4bd052d7e8b0469b2b87664388e2a99cb212ecdb Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Sun, 5 May 2019 12:55:41 -0700 Subject: [PATCH] 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 --- .clang-format | 2 +- CMakeLists.txt | 6 +++--- {db => benchmarks}/db_bench.cc | 0 {doc/bench => benchmarks}/db_bench_sqlite3.cc | 0 {doc/bench => benchmarks}/db_bench_tree_db.cc | 0 doc/benchmark.html | 6 +++--- 6 files changed, 7 insertions(+), 7 deletions(-) rename {db => benchmarks}/db_bench.cc (100%) rename {doc/bench => benchmarks}/db_bench_sqlite3.cc (100%) rename {doc/bench => benchmarks}/db_bench_tree_db.cc (100%) diff --git a/.clang-format b/.clang-format index 75f3401..f493f75 100644 --- a/.clang-format +++ b/.clang-format @@ -8,7 +8,7 @@ DerivePointerAlignment: false # Order them so that when imported to the authoritative repository they will be # in correct alphabetical order. IncludeCategories: - - Regex: '^(<|"(db|helpers)/)' + - Regex: '^(<|"(benchmarks|db|helpers)/)' Priority: 1 - Regex: '^"(leveldb)/' Priority: 2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1409c06..96592d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,12 +374,12 @@ if(LEVELDB_BUILD_BENCHMARKS) endfunction(leveldb_benchmark) if(NOT BUILD_SHARED_LIBS) - leveldb_benchmark("${PROJECT_SOURCE_DIR}/db/db_bench.cc") + leveldb_benchmark("${PROJECT_SOURCE_DIR}/benchmarks/db_bench.cc") endif(NOT BUILD_SHARED_LIBS) check_library_exists(sqlite3 sqlite3_open "" HAVE_SQLITE3) if(HAVE_SQLITE3) - leveldb_benchmark("${PROJECT_SOURCE_DIR}/doc/bench/db_bench_sqlite3.cc") + leveldb_benchmark("${PROJECT_SOURCE_DIR}/benchmarks/db_bench_sqlite3.cc") target_link_libraries(db_bench_sqlite3 sqlite3) endif(HAVE_SQLITE3) @@ -399,7 +399,7 @@ int main() { " HAVE_KYOTOCABINET) set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQURED_LIBRARIES}) if(HAVE_KYOTOCABINET) - leveldb_benchmark("${PROJECT_SOURCE_DIR}/doc/bench/db_bench_tree_db.cc") + leveldb_benchmark("${PROJECT_SOURCE_DIR}/benchmarks/db_bench_tree_db.cc") target_link_libraries(db_bench_tree_db kyotocabinet) endif(HAVE_KYOTOCABINET) endif(LEVELDB_BUILD_BENCHMARKS) diff --git a/db/db_bench.cc b/benchmarks/db_bench.cc similarity index 100% rename from db/db_bench.cc rename to benchmarks/db_bench.cc diff --git a/doc/bench/db_bench_sqlite3.cc b/benchmarks/db_bench_sqlite3.cc similarity index 100% rename from doc/bench/db_bench_sqlite3.cc rename to benchmarks/db_bench_sqlite3.cc diff --git a/doc/bench/db_bench_tree_db.cc b/benchmarks/db_bench_tree_db.cc similarity index 100% rename from doc/bench/db_bench_tree_db.cc rename to benchmarks/db_bench_tree_db.cc diff --git a/doc/benchmark.html b/doc/benchmark.html index c463977..f3fd771 100644 --- a/doc/benchmark.html +++ b/doc/benchmark.html @@ -90,9 +90,9 @@ div.bsql {

Benchmark Source Code

We wrote benchmark tools for SQLite and Kyoto TreeDB based on LevelDB's db_bench. The code for each of the benchmarks resides here:

Custom Build Specifications