add single instance for benchmark

This commit is contained in:
Maximilian Keßler 2022-04-16 21:18:34 +02:00
parent 5b1f063b21
commit 059a67836e

View file

@ -17,9 +17,22 @@ static void BM_area_computation(benchmark::State& state) {
state.SetComplexityN(state.range(0));
}
static std::vector<Rectangle> get_inst() {
srand(17);
static std::vector<Rectangle> rects = get_random_instance(1 << 18, 1<<20);
return rects;
}
static void BM_single(benchmark::State& state) {
for(auto _ :state) {
get_area_union(get_inst());
}
}
BENCHMARK(BM_single);
// add benchmark
// BENCHMARK(BM_area_computation)->ArgsProduct({benchmark::CreateRange(1<<4,1<<18,4),{1<<20}})->Complexity(benchmark::oNLogN);
BENCHMARK(BM_area_computation)->Args({{1<<18, 1<<20}});
// run benchmark as main()
int main(int argc, char **argv) {