Add benchmark programs
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -333,3 +333,11 @@ add_executable(test_runner EXCLUDE_FROM_ALL ${TEST_FILES})
target_link_libraries(test_runner lcf)
add_custom_target(check COMMAND ${PROJECT_BINARY_DIR}/test_runner)
add_dependencies(check test_runner)
+
+# benchmarks
+file(GLOB BENCH_FILES ${CMAKE_CURRENT_SOURCE_DIR}/bench/*.cpp)
+foreach(i ${BENCH_FILES})
+ get_filename_component(name "${i}" NAME_WE)
+ add_executable(bench_${name} ${i})
+ target_link_libraries(bench_${name} lcf)
+endforeach()

ADD
bench/readldb.cpp
+#include <iostream>
+#include "ldb_reader.h"
+
+int main(int argc, char** argv) {
+ if (argc < 2) {
+ std::cerr << "Must specify a file!" << std::endl;
+ return 1;
+ }
+ const auto& infile = argv[1];
+ auto rc = LDB_Reader::Load(infile, "");
+ if (!rc) {
+ std::cerr << "Failed to load file : " << infile << std::endl;
+ return 1;
+ }
+ return 0;
+}

Add benchmark programs