Skip to content

Commit

Permalink
Hardcode which time unit to use for reporting benchmark results
Browse files Browse the repository at this point in the history
Signed-off-by: Anjan Roy <[email protected]>
  • Loading branch information
itzmeanjan committed Sep 29, 2024
1 parent a5b602d commit 334c2d9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ $(BENCHMARK_BINARY): $(BENCHMARK_OBJECTS)

benchmark: $(BENCHMARK_BINARY)
# Must *not* build google-benchmark with libPFM
./$< --benchmark_time_unit=ms --benchmark_min_warmup_time=.5 --benchmark_enable_random_interleaving=true --benchmark_repetitions=10 --benchmark_min_time=0.1s --benchmark_display_aggregates_only=true --benchmark_report_aggregates_only=true --benchmark_counters_tabular=true --benchmark_out_format=json --benchmark_out=$(BENCHMARK_OUT_FILE)
./$< --benchmark_min_warmup_time=.5 --benchmark_enable_random_interleaving=true --benchmark_repetitions=10 --benchmark_min_time=0.1s --benchmark_display_aggregates_only=true --benchmark_report_aggregates_only=true --benchmark_counters_tabular=true --benchmark_out_format=json --benchmark_out=$(BENCHMARK_OUT_FILE)

$(PERF_BINARY): $(BENCHMARK_OBJECTS)
$(CXX) $(RELEASE_FLAGS) $(LINK_OPT_FLAGS) $^ $(PERF_LINK_FLAGS) -o $@

perf: $(PERF_BINARY)
# Must build google-benchmark with libPFM, follow https://gist.github.com/itzmeanjan/05dc3e946f635d00c5e0b21aae6203a7
./$< --benchmark_time_unit=ms --benchmark_min_warmup_time=.5 --benchmark_enable_random_interleaving=true --benchmark_repetitions=10 --benchmark_min_time=0.1s --benchmark_display_aggregates_only=true --benchmark_report_aggregates_only=true --benchmark_counters_tabular=true --benchmark_perf_counters=CYCLES --benchmark_out_format=json --benchmark_out=$(BENCHMARK_OUT_FILE)
./$< --benchmark_min_warmup_time=.5 --benchmark_enable_random_interleaving=true --benchmark_repetitions=10 --benchmark_min_time=0.1s --benchmark_display_aggregates_only=true --benchmark_report_aggregates_only=true --benchmark_counters_tabular=true --benchmark_perf_counters=CYCLES --benchmark_out_format=json --benchmark_out=$(BENCHMARK_OUT_FILE)

.PHONY: format clean

Expand Down
15 changes: 10 additions & 5 deletions benches/bench_client_prepare_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,37 @@ BENCHMARK(bench_client_prepare_query<128, 1ul << 16, 256, 10, 1774>)
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_client_prepare_query<128, 1ul << 17, 256, 10, 1774>)
->Name("frodoPIR/client_prepare_query/2^17/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_client_prepare_query<128, 1ul << 18, 256, 10, 1774>)
->Name("frodoPIR/client_prepare_query/2^18/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_client_prepare_query<128, 1ul << 19, 256, 9, 1774>)
->Name("frodoPIR/client_prepare_query/2^19/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_client_prepare_query<128, 1ul << 20, 256, 9, 1774>)
->Name("frodoPIR/client_prepare_query/2^20/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);
15 changes: 10 additions & 5 deletions benches/bench_client_process_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,37 @@ BENCHMARK(bench_client_process_response<128, 1ul << 16, 256, 10, 1774>)
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_process_response<128, 1ul << 17, 256, 10, 1774>)
->Name("frodoPIR/client_process_response/2^17/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_process_response<128, 1ul << 18, 256, 10, 1774>)
->Name("frodoPIR/client_process_response/2^18/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_process_response<128, 1ul << 19, 256, 9, 1774>)
->Name("frodoPIR/client_process_response/2^19/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_process_response<128, 1ul << 20, 256, 9, 1774>)
->Name("frodoPIR/client_process_response/2^20/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);
15 changes: 10 additions & 5 deletions benches/bench_client_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,32 +83,37 @@ BENCHMARK(bench_client_query<128, 1ul << 16, 256, 10, 1774>)
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_query<128, 1ul << 17, 256, 10, 1774>)
->Name("frodoPIR/client_query/2^17/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_query<128, 1ul << 18, 256, 10, 1774>)
->Name("frodoPIR/client_query/2^18/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_query<128, 1ul << 19, 256, 9, 1774>)
->Name("frodoPIR/client_query/2^19/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);

BENCHMARK(bench_client_query<128, 1ul << 20, 256, 9, 1774>)
->Name("frodoPIR/client_query/2^20/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMicrosecond);
15 changes: 10 additions & 5 deletions benches/bench_server_respond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,37 @@ BENCHMARK(bench_server_respond<128, 1ul << 16, 256, 10, 1774>)
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_server_respond<128, 1ul << 17, 256, 10, 1774>)
->Name("frodoPIR/server_respond/2^17/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_server_respond<128, 1ul << 18, 256, 10, 1774>)
->Name("frodoPIR/server_respond/2^18/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_server_respond<128, 1ul << 19, 256, 9, 1774>)
->Name("frodoPIR/server_respond/2^19/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);

BENCHMARK(bench_server_respond<128, 1ul << 20, 256, 9, 1774>)
->Name("frodoPIR/server_respond/2^20/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kMillisecond);
15 changes: 10 additions & 5 deletions benches/bench_server_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,37 @@ BENCHMARK(bench_server_setup<128, 1ul << 16, 256, 10, 1774>)
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kSecond);

BENCHMARK(bench_server_setup<128, 1ul << 17, 256, 10, 1774>)
->Name("frodoPIR/server_setup/2^17/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kSecond);

BENCHMARK(bench_server_setup<128, 1ul << 18, 256, 10, 1774>)
->Name("frodoPIR/server_setup/2^18/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kSecond);

BENCHMARK(bench_server_setup<128, 1ul << 19, 256, 9, 1774>)
->Name("frodoPIR/server_setup/2^19/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kSecond);

BENCHMARK(bench_server_setup<128, 1ul << 20, 256, 9, 1774>)
->Name("frodoPIR/server_setup/2^20/256B")
->ComputeStatistics("min", compute_min)
->ComputeStatistics("max", compute_max)
->MeasureProcessCPUTime()
->UseRealTime();
->UseRealTime()
->Unit(benchmark::kSecond);

0 comments on commit 334c2d9

Please sign in to comment.