Skip to content

Commit

Permalink
apacheGH-39306: [C++][Benchmarking] Remove hardcoded min times (apach…
Browse files Browse the repository at this point in the history
…e#39307)

### Rationale for this change

`MinTime` settings hardcoded in the C++ source code prevent the `--benchmark_min_time` CLI option from working.

### Are these changes tested?

No.

### Are there any user-facing changes?

No.
* Closes: apache#39306

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
pitrou authored Dec 20, 2023
1 parent b1fcba1 commit 87865b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ BENCHMARK(NthToIndicesInt64)
->Apply(RegressionSetArgs)
->Args({1 << 20, 100})
->Args({1 << 23, 100})
->MinTime(1.0)
->Unit(benchmark::TimeUnit::kNanosecond);

} // namespace compute
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/compute/kernels/vector_topk_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ BENCHMARK(SelectKInt64)
->Apply(RegressionSetArgs)
->Args({1 << 20, 100})
->Args({1 << 23, 100})
->MinTime(1.0)
->Unit(benchmark::TimeUnit::kNanosecond);

} // namespace compute
Expand Down
38 changes: 19 additions & 19 deletions cpp/src/gandiva/tests/micro_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,24 +460,24 @@ static void DecimalAdd3Large(benchmark::State& state) {
DoDecimalAdd3(state, DecimalTypeUtil::kMaxPrecision, 18, true);
}

BENCHMARK(TimedTestAdd3)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestBigNested)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestExtractYear)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestFilterAdd2)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestFilterLike)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestCastFloatFromString)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestCastIntFromString)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestAllocs)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestOutputStringAllocs)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestMultiOr)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestInExpr)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2Fast)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2LeadingZeroes)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2LeadingZeroesWithDiv)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2Large)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3Fast)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3LeadingZeroes)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3LeadingZeroesWithDiv)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3Large)->MinTime(1.0)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestAdd3)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestBigNested)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestExtractYear)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestFilterAdd2)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestFilterLike)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestCastFloatFromString)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestCastIntFromString)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestAllocs)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestOutputStringAllocs)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestMultiOr)->Unit(benchmark::kMicrosecond);
BENCHMARK(TimedTestInExpr)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2Fast)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2LeadingZeroes)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2LeadingZeroesWithDiv)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd2Large)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3Fast)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3LeadingZeroes)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3LeadingZeroesWithDiv)->Unit(benchmark::kMicrosecond);
BENCHMARK(DecimalAdd3Large)->Unit(benchmark::kMicrosecond);

} // namespace gandiva

0 comments on commit 87865b5

Please sign in to comment.