forked from cmu-db/noisepage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Templated perf monitor and benchmark (cmu-db#1123)
- Loading branch information
1 parent
f7b60df
commit e105d4e
Showing
6 changed files
with
164 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ADD_TERRIER_BENCHMARKS() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "benchmark/benchmark.h" | ||
#include "common/perf_monitor.h" | ||
|
||
namespace terrier { | ||
|
||
/** | ||
* These benchmarks exist to verify the performance difference between grouped and ungrouped perf counters. We do not | ||
* include them in our CI regression checks since their behavior is determined more by the OS than our wrapper. | ||
*/ | ||
class PerfMonitorBenchmark : public benchmark::Fixture {}; | ||
|
||
/** | ||
* Benchmark with inherit flag (count children) false | ||
*/ | ||
// NOLINTNEXTLINE | ||
BENCHMARK_DEFINE_F(PerfMonitorBenchmark, Basic)(benchmark::State &state) { | ||
common::PerfMonitor<false> monitor; | ||
// NOLINTNEXTLINE | ||
for (auto _ : state) { | ||
monitor.Start(); | ||
monitor.Stop(); | ||
monitor.Counters(); | ||
} | ||
state.SetItemsProcessed(state.iterations()); | ||
} | ||
|
||
/** | ||
* Benchmark with inherit flag (count children) true | ||
*/ | ||
// NOLINTNEXTLINE | ||
BENCHMARK_DEFINE_F(PerfMonitorBenchmark, Inherit)(benchmark::State &state) { | ||
common::PerfMonitor<true> monitor; | ||
// NOLINTNEXTLINE | ||
for (auto _ : state) { | ||
monitor.Start(); | ||
monitor.Stop(); | ||
monitor.Counters(); | ||
} | ||
state.SetItemsProcessed(state.iterations()); | ||
} | ||
|
||
BENCHMARK_REGISTER_F(PerfMonitorBenchmark, Basic); | ||
|
||
BENCHMARK_REGISTER_F(PerfMonitorBenchmark, Inherit); | ||
} // namespace terrier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters