add single instance for benchmark
This commit is contained in:
parent
5b1f063b21
commit
059a67836e
1 changed files with 14 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue