-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |