From edb122cb33585803e709ac867f6058009eede244 Mon Sep 17 00:00:00 2001 From: jbajic Date: Mon, 12 Dec 2022 16:01:20 +0100 Subject: [PATCH] Fix benchmark tests --- tests/benchmark/data_structures_common.hpp | 6 ++---- tests/benchmark/data_structures_contains.cpp | 3 +-- tests/benchmark/data_structures_find.cpp | 3 +-- tests/benchmark/data_structures_insert.cpp | 7 ++----- tests/benchmark/data_structures_remove.cpp | 3 +-- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/benchmark/data_structures_common.hpp b/tests/benchmark/data_structures_common.hpp index 23fe394ee..4c2d41fc0 100644 --- a/tests/benchmark/data_structures_common.hpp +++ b/tests/benchmark/data_structures_common.hpp @@ -17,9 +17,9 @@ #include "coordinator/hybrid_logical_clock.hpp" #include "storage/v3/key_store.hpp" -#include "storage/v3/lexicographically_ordered_vertex.hpp" #include "storage/v3/mvcc.hpp" #include "storage/v3/transaction.hpp" +#include "storage/v3/vertex.hpp" #include "utils/skip_list.hpp" namespace memgraph::benchmark { @@ -40,9 +40,7 @@ inline void PrepareData(std::map &std_map, const int64_t num_eleme storage::v3::Transaction transaction{start_timestamp, storage::v3::IsolationLevel::SNAPSHOT_ISOLATION}; auto *delta = storage::v3::CreateDeleteObjectDelta(&transaction); for (auto i{0}; i < num_elements; ++i) { - std_map.insert({storage::v3::PrimaryKey{storage::v3::PropertyValue{i}}, - storage::v3::LexicographicallyOrderedVertex{storage::v3::Vertex{ - delta, std::vector{storage::v3::PropertyValue{true}}}}}); + std_map.insert({storage::v3::PrimaryKey{storage::v3::PropertyValue{i}}, storage::v3::VertexData{delta}}); } } diff --git a/tests/benchmark/data_structures_contains.cpp b/tests/benchmark/data_structures_contains.cpp index 47af24a1b..679adee1f 100644 --- a/tests/benchmark/data_structures_contains.cpp +++ b/tests/benchmark/data_structures_contains.cpp @@ -25,7 +25,6 @@ #include "data_structures_common.hpp" #include "storage/v3/key_store.hpp" -#include "storage/v3/lexicographically_ordered_vertex.hpp" #include "storage/v3/mvcc.hpp" #include "storage/v3/property_value.hpp" #include "storage/v3/transaction.hpp" @@ -57,7 +56,7 @@ static void BM_BenchmarkContainsSkipList(::benchmark::State &state) { } static void BM_BenchmarkContainsStdMap(::benchmark::State &state) { - std::map std_map; + std::map std_map; PrepareData(std_map, state.range(0)); // So we can also have elements that does don't exist diff --git a/tests/benchmark/data_structures_find.cpp b/tests/benchmark/data_structures_find.cpp index d51771be5..fc0473909 100644 --- a/tests/benchmark/data_structures_find.cpp +++ b/tests/benchmark/data_structures_find.cpp @@ -25,7 +25,6 @@ #include "data_structures_common.hpp" #include "storage/v3/key_store.hpp" -#include "storage/v3/lexicographically_ordered_vertex.hpp" #include "storage/v3/mvcc.hpp" #include "storage/v3/property_value.hpp" #include "storage/v3/transaction.hpp" @@ -57,7 +56,7 @@ static void BM_BenchmarkFindSkipList(::benchmark::State &state) { } static void BM_BenchmarkFindStdMap(::benchmark::State &state) { - std::map std_map; + std::map std_map; PrepareData(std_map, state.range(0)); // So we can also have elements that does don't exist std::mt19937 i_generator(std::random_device{}()); diff --git a/tests/benchmark/data_structures_insert.cpp b/tests/benchmark/data_structures_insert.cpp index d83cbfe23..b5dc99f38 100644 --- a/tests/benchmark/data_structures_insert.cpp +++ b/tests/benchmark/data_structures_insert.cpp @@ -24,7 +24,6 @@ #include #include "storage/v3/key_store.hpp" -#include "storage/v3/lexicographically_ordered_vertex.hpp" #include "storage/v3/mvcc.hpp" #include "storage/v3/property_value.hpp" #include "storage/v3/transaction.hpp" @@ -50,16 +49,14 @@ static void BM_BenchmarkInsertSkipList(::benchmark::State &state) { } static void BM_BenchmarkInsertStdMap(::benchmark::State &state) { - std::map std_map; + std::map std_map; coordinator::Hlc start_timestamp; storage::v3::Transaction transaction{start_timestamp, storage::v3::IsolationLevel::SNAPSHOT_ISOLATION}; auto *delta = storage::v3::CreateDeleteObjectDelta(&transaction); for (auto _ : state) { for (auto i{0}; i < state.range(0); ++i) { - std_map.insert({storage::v3::PrimaryKey{storage::v3::PropertyValue{i}}, - storage::v3::LexicographicallyOrderedVertex{storage::v3::Vertex{ - delta, std::vector{storage::v3::PropertyValue{true}}}}}); + std_map.insert({storage::v3::PrimaryKey{storage::v3::PropertyValue{i}}, storage::v3::VertexData{delta}}); } } } diff --git a/tests/benchmark/data_structures_remove.cpp b/tests/benchmark/data_structures_remove.cpp index 641ad9453..2d060961d 100644 --- a/tests/benchmark/data_structures_remove.cpp +++ b/tests/benchmark/data_structures_remove.cpp @@ -25,7 +25,6 @@ #include "data_structures_common.hpp" #include "storage/v3/key_store.hpp" -#include "storage/v3/lexicographically_ordered_vertex.hpp" #include "storage/v3/mvcc.hpp" #include "storage/v3/property_value.hpp" #include "storage/v3/transaction.hpp" @@ -58,7 +57,7 @@ static void BM_BenchmarkRemoveSkipList(::benchmark::State &state) { } static void BM_BenchmarkRemoveStdMap(::benchmark::State &state) { - std::map std_map; + std::map std_map; PrepareData(std_map, state.range(0)); // So we can also have elements that does don't exist