From 5cc3a6edec99b6101c46e714bd100f6de652e852 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 9 Oct 2024 16:58:07 +0100 Subject: [PATCH] Kosaraju benchmarks added --- benchmark/Kosaraju_BM.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 benchmark/Kosaraju_BM.cpp diff --git a/benchmark/Kosaraju_BM.cpp b/benchmark/Kosaraju_BM.cpp new file mode 100644 index 00000000..5e6039b3 --- /dev/null +++ b/benchmark/Kosaraju_BM.cpp @@ -0,0 +1,30 @@ +#include + +#include "CXXGraph/CXXGraph.hpp" +#include "Utilities.hpp" + +static void Kosaraju_X(benchmark::State &state) { + CXXGraph::Graph g; + auto range_start = edges.begin(); + auto range_end = edges.find(state.range(0)); + std::unordered_map *> edgesX; + edgesX.insert(range_start, range_end); + for (auto e : edgesX) { + g.addEdge(&(*e.second)); + } + for (auto _ : state) { + const auto &result = g.kosaraju(); + } +} +BENCHMARK(Kosaraju_X) + ->RangeMultiplier(16) + ->Range((unsigned long)1, (unsigned long)1 << 16); + +static void Kosaraju_FromReadedCitHep(benchmark::State &state) { + auto edgeSet = cit_graph_ptr->getEdgeSet(); + for (auto _ : state) { + const auto &result = cit_graph_ptr->kosaraju(); + } +} + +BENCHMARK(Kosaraju_FromReadedCitHep); \ No newline at end of file