Skip to content

Commit

Permalink
Adding chunk size to sort benchmark (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsthamm authored May 25, 2017
1 parent 4a95f7f commit 1268422
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/benchmark/operators/sort_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@

namespace opossum {

BENCHMARK_F(BenchmarkBasicFixture, BM_Sort)(benchmark::State& state) {
BENCHMARK_DEFINE_F(BenchmarkBasicFixture, BM_Sort_ChunkSize)(benchmark::State& state) {
clear_cache();
auto warm_up = std::make_shared<Sort>(_table_wrapper_a, "a");
auto warm_up = std::make_shared<Sort>(_table_wrapper_a, "a", state.range(0));
warm_up->execute();
while (state.KeepRunning()) {
auto sort = std::make_shared<Sort>(_table_wrapper_a, "a");
auto sort = std::make_shared<Sort>(_table_wrapper_a, "a", state.range(0));
sort->execute();
}
}

static void ChunkSize(benchmark::internal::Benchmark* b) {
for (int i : {0, 100}) b->Args({i}); // i = chunk size
}

BENCHMARK_REGISTER_F(BenchmarkBasicFixture, BM_Sort_ChunkSize)->Apply(ChunkSize);

} // namespace opossum

0 comments on commit 1268422

Please sign in to comment.