21 #include "benchmark/benchmark.h" 26 void BM_StressTest(benchmark::State& state) {
27 const int num_nodes = state.range(0);
28 while (state.KeepRunningBatch(num_nodes)) {
30 std::vector<absl::synchronization_internal::GraphId> nodes(num_nodes);
31 for (
int i = 0;
i < num_nodes;
i++) {
32 nodes[
i] = g.
GetId(reinterpret_cast<void*>(static_cast<uintptr_t>(
i)));
34 for (
int i = 0;
i < num_nodes;
i++) {
35 int end = std::min(num_nodes,
i + 5);
36 for (
int j =
i + 1; j <
end; j++) {
42 BENCHMARK(BM_StressTest)->Range(2048, 1048576);
bool InsertEdge(GraphId source_node, GraphId dest_node)
#define ABSL_RAW_CHECK(condition, message)