Skip to content

Commit

Permalink
Kosaraju benchmarks added (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
danrr02 authored Oct 10, 2024
1 parent ffab0bc commit 33dff88
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions benchmark/Kosaraju_BM.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <benchmark/benchmark.h>

#include "CXXGraph/CXXGraph.hpp"
#include "Utilities.hpp"

static void Kosaraju_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
auto range_start = edges.begin();
auto range_end = edges.find(state.range(0));
std::unordered_map<unsigned long, CXXGraph::Edge<int> *> 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);

0 comments on commit 33dff88

Please sign in to comment.