From 40ce388fb03478116cad5ae01a21743bfddd76fb Mon Sep 17 00:00:00 2001 From: YuhangQ Date: Fri, 29 Oct 2021 10:27:11 +0800 Subject: [PATCH] performance optimize --- CMakeLists.txt | 2 ++ invodb/btree/btree_uuid.cpp | 1 + invodb/main.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24a5666..19d7642 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(InvoDB) set(CMAKE_CXX_STANDARD 14) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") include_directories(.) include_directories(./invodb) diff --git a/invodb/btree/btree_uuid.cpp b/invodb/btree/btree_uuid.cpp index c777b6f..1b0739b 100644 --- a/invodb/btree/btree_uuid.cpp +++ b/invodb/btree/btree_uuid.cpp @@ -6,6 +6,7 @@ BTreeUUID::BTreeUUID(const int& address) { root = address; + n_size = 0; } int BTreeUUID::find(const std::string& uuid) { diff --git a/invodb/main.cpp b/invodb/main.cpp index bc1489f..7fdd054 100644 --- a/invodb/main.cpp +++ b/invodb/main.cpp @@ -29,7 +29,7 @@ int main() { col->insert(json); BTreeUUID *btree = new BTreeUUID(PageManager::Instance().allocate()); - btree->testAndBenchmark(1000); + btree->testAndBenchmark(100000); return 0; } \ No newline at end of file