Add MB/s measures in the benchmarks.

Current output on my machine is:

-----------------------------------------------------------------------------------------
Benchmark                                                  Time           CPU Iterations
-----------------------------------------------------------------------------------------
BM_ArenaOneAlloc                                          21 ns         21 ns   33344552
BM_ArenaInitialBlockOneAlloc                               6 ns          6 ns  115948084
BM_LoadDescriptor_Upb                                 107286 ns     107275 ns       6512   67.5731MB/s
BM_LoadDescriptor_Proto2                              240539 ns     240537 ns       2909   30.1362MB/s
BM_ParseDescriptor_Upb_LargeInitialBlock               11500 ns      11499 ns      60864   630.377MB/s
BM_ParseDescriptor_Upb                                 11920 ns      11920 ns      58676   608.123MB/s
BM_ParseDescriptor_Proto2_NoArena                      31338 ns      31336 ns      22389   231.325MB/s
BM_ParseDescriptor_Proto2_Arena                        21622 ns      21622 ns      32472    335.26MB/s
BM_ParseDescriptor_Proto2_Arena_LargeInitialBlock      17799 ns      17798 ns      39266   407.288MB/s
BM_SerializeDescriptor_Proto2                           4943 ns       4942 ns     141050   1.43252GB/s
BM_SerializeDescriptor_Upb                             12262 ns      12261 ns      57131   591.195MB/s
pull/13171/head
Joshua Haberman 4 years ago
parent 1ce98b86ec
commit 42d2f6cef9
  1. 2
      tests/benchmark.cc

@ -43,6 +43,7 @@ static void BM_LoadDescriptor_Upb(benchmark::State& state) {
exit(1); exit(1);
} }
} }
state.SetBytesProcessed(state.iterations() * descriptor.size);
} }
BENCHMARK(BM_LoadDescriptor_Upb); BENCHMARK(BM_LoadDescriptor_Upb);
@ -60,6 +61,7 @@ static void BM_LoadDescriptor_Proto2(benchmark::State& state) {
exit(1); exit(1);
} }
} }
state.SetBytesProcessed(state.iterations() * descriptor.size);
} }
BENCHMARK(BM_LoadDescriptor_Proto2); BENCHMARK(BM_LoadDescriptor_Proto2);

Loading…
Cancel
Save