[perf] Cleanup range specifiers in set benchmark.

This commit is contained in:
Garret Rieger 2022-04-20 21:34:45 +00:00 committed by Behdad Esfahbod
parent 178c67003f
commit 2b03bcedef
1 changed files with 12 additions and 16 deletions

View File

@ -44,10 +44,9 @@ static void BM_SetInsert_1000(benchmark::State& state) {
} }
BENCHMARK(BM_SetInsert_1000) BENCHMARK(BM_SetInsert_1000)
->Unit(benchmark::kMicrosecond) ->Unit(benchmark::kMicrosecond)
->ArgsProduct({ ->Ranges(
benchmark::CreateRange(1 << 10, 1 << 16, 8), // Set size {{1 << 10, 1 << 16}, // Set Size
benchmark::CreateRange(2, 400, 8) // Density {2, 512}}); // Density
});
/* Insert a 1000 values into set of varying sizes. */ /* Insert a 1000 values into set of varying sizes. */
static void BM_SetOrderedInsert_1000(benchmark::State& state) { static void BM_SetOrderedInsert_1000(benchmark::State& state) {
@ -70,10 +69,9 @@ static void BM_SetOrderedInsert_1000(benchmark::State& state) {
} }
BENCHMARK(BM_SetOrderedInsert_1000) BENCHMARK(BM_SetOrderedInsert_1000)
->Unit(benchmark::kMicrosecond) ->Unit(benchmark::kMicrosecond)
->ArgsProduct({ ->Ranges(
benchmark::CreateRange(1 << 10, 1 << 16, 8), // Set size {{1 << 10, 1 << 16}, // Set Size
benchmark::CreateRange(2, 400, 8) // Density {2, 512}}); // Density
});
/* Single value lookup on sets of various sizes. */ /* Single value lookup on sets of various sizes. */
static void BM_SetLookup(benchmark::State& state) { static void BM_SetLookup(benchmark::State& state) {
@ -92,10 +90,9 @@ static void BM_SetLookup(benchmark::State& state) {
hb_set_destroy(original); hb_set_destroy(original);
} }
BENCHMARK(BM_SetLookup) BENCHMARK(BM_SetLookup)
->ArgsProduct({ ->Ranges(
benchmark::CreateRange(1 << 10, 1 << 16, 8), // Set size {{1 << 10, 1 << 16}, // Set Size
benchmark::CreateRange(2, 400, 8) // Density {2, 512}}); // Density
});
/* Full iteration of sets of varying sizes. */ /* Full iteration of sets of varying sizes. */
static void BM_SetIteration(benchmark::State& state) { static void BM_SetIteration(benchmark::State& state) {
@ -114,9 +111,8 @@ static void BM_SetIteration(benchmark::State& state) {
hb_set_destroy(original); hb_set_destroy(original);
} }
BENCHMARK(BM_SetIteration) BENCHMARK(BM_SetIteration)
->ArgsProduct({ ->Ranges(
benchmark::CreateRange(1 << 10, 1 << 16, 8), // Set size {{1 << 10, 1 << 16}, // Set Size
benchmark::CreateRange(2, 400, 8) // Density {2, 512}}); // Density
});
BENCHMARK_MAIN(); BENCHMARK_MAIN();