Commit b20cd8da authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

require trailing ; when using BENCHMARK_DRAW_LINE macro

Summary:
Macro BENCHMARK_DRAW_LINE can be used as the following:
```lang=bash
BENCHMARK_DRAW_LINE()
BENCHMARK_DRAW_LINE();
```
This inconsistency was detected by `-Wextra-semi` in the latest clang. This diff removes the trailing `;` inside `BENCHMARK_DRAW_LINE` and updates all of the references.

```lang=bash
fbgr -sl 'BENCHMARK_DRAW_LINE\(\)' | xargs perl -pi -e 's,(?<!#define )BENCHMARK_DRAW_LINE\(\)(?!;),BENCHMARK_DRAW_LINE\(\);,'
```

Reviewed By: yfeldblum

Differential Revision: D7382525

fbshipit-source-id: 76f1da01bb4dde1b0fa4ebf98748d001d8e04ab0
parent 8581e9e0
...@@ -547,10 +547,10 @@ void printResultComparison( ...@@ -547,10 +547,10 @@ void printResultComparison(
/** /**
* Draws a line of dashes. * Draws a line of dashes.
*/ */
#define BENCHMARK_DRAW_LINE() \ #define BENCHMARK_DRAW_LINE() \
static bool FB_ANONYMOUS_VARIABLE(follyBenchmarkUnused) = ( \ static bool FB_ANONYMOUS_VARIABLE(follyBenchmarkUnused) = \
::folly::addBenchmark(__FILE__, "-", []() -> unsigned { return 0; }), \ (::folly::addBenchmark(__FILE__, "-", []() -> unsigned { return 0; }), \
true); true)
/** /**
* Allows execution of code that doesn't count torward the benchmark's * Allows execution of code that doesn't count torward the benchmark's
......
...@@ -242,7 +242,7 @@ contentionAtWidthPthreadSelf(size_t iters, size_t stripes, size_t work) { ...@@ -242,7 +242,7 @@ contentionAtWidthPthreadSelf(size_t iters, size_t stripes, size_t work) {
contentionAtWidth<PthreadSelfTag>(iters, stripes, work); contentionAtWidth<PthreadSelfTag>(iters, stripes, work);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_0_work, 1, 0) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_0_work, 1, 0)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_0_work, 2, 0) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_0_work, 2, 0)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_0_work, 4, 0) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_0_work, 4, 0)
...@@ -263,7 +263,7 @@ BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 16_stripe_0_work, 16, 0) ...@@ -263,7 +263,7 @@ BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 16_stripe_0_work, 16, 0)
BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 32_stripe_0_work, 32, 0) BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 32_stripe_0_work, 32, 0)
BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 64_stripe_0_work, 64, 0) BENCHMARK_NAMED_PARAM(contentionAtWidthPthreadSelf, 64_stripe_0_work, 64, 0)
BENCHMARK_NAMED_PARAM(atomicIncrBaseline, local_incr_0_work, 0) BENCHMARK_NAMED_PARAM(atomicIncrBaseline, local_incr_0_work, 0)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_500_work, 1, 500) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_500_work, 1, 500)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_500_work, 2, 500) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_500_work, 2, 500)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_500_work, 4, 500) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_500_work, 4, 500)
...@@ -271,7 +271,7 @@ BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 8_stripe_500_work, 8, 500) ...@@ -271,7 +271,7 @@ BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 8_stripe_500_work, 8, 500)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 16_stripe_500_work, 16, 500) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 16_stripe_500_work, 16, 500)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 32_stripe_500_work, 32, 500) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 32_stripe_500_work, 32, 500)
BENCHMARK_NAMED_PARAM(atomicIncrBaseline, local_incr_500_work, 500) BENCHMARK_NAMED_PARAM(atomicIncrBaseline, local_incr_500_work, 500)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_1000_work, 1, 1000) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 1_stripe_1000_work, 1, 1000)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_1000_work, 2, 1000) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 2_stripe_1000_work, 2, 1000)
BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_1000_work, 4, 1000) BENCHMARK_NAMED_PARAM(contentionAtWidthGetcpu, 4_stripe_1000_work, 4, 1000)
......
...@@ -71,11 +71,11 @@ BENCHMARK_RELATIVE(no_combining_dup, iters) { ...@@ -71,11 +71,11 @@ BENCHMARK_RELATIVE(no_combining_dup, iters) {
tc, tc,
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
// dedicated combiner // dedicated combiner
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_dedicated_notc_sync, iters) { BENCHMARK_RELATIVE(combining_dedicated_notc_sync, iters) {
fc = true; fc = true;
...@@ -109,7 +109,7 @@ BENCHMARK_RELATIVE(combining_dedicated_notc_sync_dup, iters) { ...@@ -109,7 +109,7 @@ BENCHMARK_RELATIVE(combining_dedicated_notc_sync_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_dedicated_notc_async, iters) { BENCHMARK_RELATIVE(combining_dedicated_notc_async, iters) {
syncops = false; syncops = false;
...@@ -140,7 +140,7 @@ BENCHMARK_RELATIVE(combining_dedicated_notc_async_dup, iters) { ...@@ -140,7 +140,7 @@ BENCHMARK_RELATIVE(combining_dedicated_notc_async_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_dedicated_tc_sync, iters) { BENCHMARK_RELATIVE(combining_dedicated_tc_sync, iters) {
tc = true; tc = true;
...@@ -172,7 +172,7 @@ BENCHMARK_RELATIVE(combining_dedicated_tc_sync_dup, iters) { ...@@ -172,7 +172,7 @@ BENCHMARK_RELATIVE(combining_dedicated_tc_sync_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_dedicated_tc_async, iters) { BENCHMARK_RELATIVE(combining_dedicated_tc_async, iters) {
tc = true; tc = true;
...@@ -204,11 +204,11 @@ BENCHMARK_RELATIVE(combining_dedicated_tc_async_dup, iters) { ...@@ -204,11 +204,11 @@ BENCHMARK_RELATIVE(combining_dedicated_tc_async_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
// no dedicated combiner // no dedicated combiner
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_no_dedicated_notc_sync, iters) { BENCHMARK_RELATIVE(combining_no_dedicated_notc_sync, iters) {
dedicated = false; dedicated = false;
...@@ -241,7 +241,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_notc_sync_dup, iters) { ...@@ -241,7 +241,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_notc_sync_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_no_dedicated_notc_async, iters) { BENCHMARK_RELATIVE(combining_no_dedicated_notc_async, iters) {
syncops = false; syncops = false;
...@@ -272,7 +272,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_notc_async_dup, iters) { ...@@ -272,7 +272,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_notc_async_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_no_dedicated_tc_sync, iters) { BENCHMARK_RELATIVE(combining_no_dedicated_tc_sync, iters) {
tc = true; tc = true;
...@@ -304,7 +304,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_tc_sync_dup, iters) { ...@@ -304,7 +304,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_tc_sync_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_RELATIVE(combining_no_dedicated_tc_async, iters) { BENCHMARK_RELATIVE(combining_no_dedicated_tc_async, iters) {
tc = true; tc = true;
...@@ -336,7 +336,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_tc_async_dup, iters) { ...@@ -336,7 +336,7 @@ BENCHMARK_RELATIVE(combining_no_dedicated_tc_async_dup, iters) {
syncops); syncops);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
void benchmarkSetup() { void benchmarkSetup() {
int numCores = std::thread::hardware_concurrency(); int numCores = std::thread::hardware_concurrency();
......
...@@ -61,7 +61,7 @@ BENCHMARK_RELATIVE(withThen) { ...@@ -61,7 +61,7 @@ BENCHMARK_RELATIVE(withThen) {
} }
// thens // thens
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(oneThen) { BENCHMARK(oneThen) {
someThens(1); someThens(1);
...@@ -85,7 +85,7 @@ BENCHMARK_RELATIVE(hundredThens) { ...@@ -85,7 +85,7 @@ BENCHMARK_RELATIVE(hundredThens) {
// Lock contention. Although in practice fulfills tend to be temporally // Lock contention. Although in practice fulfills tend to be temporally
// separate from then()s, still sometimes they will be concurrent. So the // separate from then()s, still sometimes they will be concurrent. So the
// higher this number is, the better. // higher this number is, the better.
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(no_contention) { BENCHMARK(no_contention) {
std::vector<Promise<int>> promises(10000); std::vector<Promise<int>> promises(10000);
......
...@@ -67,7 +67,7 @@ BENCHMARK_RELATIVE(Sum_Basic_Gen, iters) { ...@@ -67,7 +67,7 @@ BENCHMARK_RELATIVE(Sum_Basic_Gen, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Sum_Vector_NoGen, iters) { BENCHMARK(Sum_Vector_NoGen, iters) {
int s = 0; int s = 0;
...@@ -87,7 +87,7 @@ BENCHMARK_RELATIVE(Sum_Vector_Gen, iters) { ...@@ -87,7 +87,7 @@ BENCHMARK_RELATIVE(Sum_Vector_Gen, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Member, iters) { BENCHMARK(Member, iters) {
int s = 0; int s = 0;
...@@ -109,7 +109,7 @@ BENCHMARK_RELATIVE(MapMember, iters) { ...@@ -109,7 +109,7 @@ BENCHMARK_RELATIVE(MapMember, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Count_Vector_NoGen, iters) { BENCHMARK(Count_Vector_NoGen, iters) {
int s = 0; int s = 0;
...@@ -135,7 +135,7 @@ BENCHMARK_RELATIVE(Count_Vector_Gen, iters) { ...@@ -135,7 +135,7 @@ BENCHMARK_RELATIVE(Count_Vector_Gen, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Fib_Sum_NoGen, iters) { BENCHMARK(Fib_Sum_NoGen, iters) {
int s = 0; int s = 0;
...@@ -213,7 +213,7 @@ BENCHMARK_RELATIVE(Fib_Sum_Gen_Static, iters) { ...@@ -213,7 +213,7 @@ BENCHMARK_RELATIVE(Fib_Sum_Gen_Static, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(VirtualGen_0Virtual, iters) { BENCHMARK(VirtualGen_0Virtual, iters) {
int s = 0; int s = 0;
...@@ -259,7 +259,7 @@ BENCHMARK_RELATIVE(VirtualGen_3Virtual, iters) { ...@@ -259,7 +259,7 @@ BENCHMARK_RELATIVE(VirtualGen_3Virtual, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Concat_NoGen, iters) { BENCHMARK(Concat_NoGen, iters) {
int s = 0; int s = 0;
...@@ -281,7 +281,7 @@ BENCHMARK_RELATIVE(Concat_Gen, iters) { ...@@ -281,7 +281,7 @@ BENCHMARK_RELATIVE(Concat_Gen, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Composed_NoGen, iters) { BENCHMARK(Composed_NoGen, iters) {
int s = 0; int s = 0;
...@@ -310,7 +310,7 @@ BENCHMARK_RELATIVE(Composed_GenRegular, iters) { ...@@ -310,7 +310,7 @@ BENCHMARK_RELATIVE(Composed_GenRegular, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(Sample, iters) { BENCHMARK(Sample, iters) {
size_t s = 0; size_t s = 0;
......
...@@ -81,7 +81,7 @@ BENCHMARK_RELATIVE(StringResplitter_Small, iters) { ...@@ -81,7 +81,7 @@ BENCHMARK_RELATIVE(StringResplitter_Small, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(StringSplit_Old, iters) { BENCHMARK(StringSplit_Old, iters) {
size_t s = 0; size_t s = 0;
...@@ -104,7 +104,7 @@ BENCHMARK_RELATIVE(StringSplit_Gen_Vector, iters) { ...@@ -104,7 +104,7 @@ BENCHMARK_RELATIVE(StringSplit_Gen_Vector, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(StringSplit_Old_ReuseVector, iters) { BENCHMARK(StringSplit_Old_ReuseVector, iters) {
size_t s = 0; size_t s = 0;
...@@ -148,7 +148,7 @@ BENCHMARK_RELATIVE(StringSplit_Gen_Take, iters) { ...@@ -148,7 +148,7 @@ BENCHMARK_RELATIVE(StringSplit_Gen_Take, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(StringUnsplit_Old, iters) { BENCHMARK(StringUnsplit_Old, iters) {
size_t s = 0; size_t s = 0;
...@@ -191,7 +191,7 @@ BENCHMARK_RELATIVE(StringUnsplit_Gen_ReusedBuffer, iters) { ...@@ -191,7 +191,7 @@ BENCHMARK_RELATIVE(StringUnsplit_Gen_ReusedBuffer, iters) {
folly::doNotOptimizeAway(s); folly::doNotOptimizeAway(s);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
void StringUnsplit_Gen(size_t iters, size_t joinSize) { void StringUnsplit_Gen(size_t iters, size_t joinSize) {
std::vector<fbstring> v; std::vector<fbstring> v;
...@@ -215,7 +215,7 @@ BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 2000) ...@@ -215,7 +215,7 @@ BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 2000)
BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 4000) BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 4000)
BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 8000) BENCHMARK_RELATIVE_PARAM(StringUnsplit_Gen, 8000)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
void Lines_Gen(size_t iters, int joinSize) { void Lines_Gen(size_t iters, int joinSize) {
size_t s = 0; size_t s = 0;
StringPiece content = testFileContent; StringPiece content = testFileContent;
...@@ -229,7 +229,7 @@ BENCHMARK_PARAM(Lines_Gen, 1e3) ...@@ -229,7 +229,7 @@ BENCHMARK_PARAM(Lines_Gen, 1e3)
BENCHMARK_RELATIVE_PARAM(Lines_Gen, 2e3) BENCHMARK_RELATIVE_PARAM(Lines_Gen, 2e3)
BENCHMARK_RELATIVE_PARAM(Lines_Gen, 3e3) BENCHMARK_RELATIVE_PARAM(Lines_Gen, 3e3)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
fbstring records fbstring records
= seq<size_t>(1, 1000) = seq<size_t>(1, 1000)
......
...@@ -75,31 +75,31 @@ void zeroCopyOff(unsigned /* unused */, size_t bufferSize) { ...@@ -75,31 +75,31 @@ void zeroCopyOff(unsigned /* unused */, size_t bufferSize) {
BENCHMARK_PARAM(zeroCopyOn, 4096); BENCHMARK_PARAM(zeroCopyOn, 4096);
BENCHMARK_PARAM(zeroCopyOff, 4096); BENCHMARK_PARAM(zeroCopyOff, 4096);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 8192); BENCHMARK_PARAM(zeroCopyOn, 8192);
BENCHMARK_PARAM(zeroCopyOff, 8192); BENCHMARK_PARAM(zeroCopyOff, 8192);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 16384); BENCHMARK_PARAM(zeroCopyOn, 16384);
BENCHMARK_PARAM(zeroCopyOff, 16384); BENCHMARK_PARAM(zeroCopyOff, 16384);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 32768); BENCHMARK_PARAM(zeroCopyOn, 32768);
BENCHMARK_PARAM(zeroCopyOff, 32768); BENCHMARK_PARAM(zeroCopyOff, 32768);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 65536); BENCHMARK_PARAM(zeroCopyOn, 65536);
BENCHMARK_PARAM(zeroCopyOff, 65536); BENCHMARK_PARAM(zeroCopyOff, 65536);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 131072); BENCHMARK_PARAM(zeroCopyOn, 131072);
BENCHMARK_PARAM(zeroCopyOff, 131072); BENCHMARK_PARAM(zeroCopyOff, 131072);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 262144); BENCHMARK_PARAM(zeroCopyOn, 262144);
BENCHMARK_PARAM(zeroCopyOff, 262144); BENCHMARK_PARAM(zeroCopyOff, 262144);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 524288); BENCHMARK_PARAM(zeroCopyOn, 524288);
BENCHMARK_PARAM(zeroCopyOff, 524288); BENCHMARK_PARAM(zeroCopyOff, 524288);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_PARAM(zeroCopyOn, 1048576); BENCHMARK_PARAM(zeroCopyOn, 1048576);
BENCHMARK_PARAM(zeroCopyOff, 1048576); BENCHMARK_PARAM(zeroCopyOff, 1048576);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
DEFINE_bool(client, false, "client mode"); DEFINE_bool(client, false, "client mode");
DEFINE_bool(server, false, "server mode"); DEFINE_bool(server, false, "server mode");
......
...@@ -216,7 +216,7 @@ BENCHMARK(bmUMArena, iters) { ...@@ -216,7 +216,7 @@ BENCHMARK(bmUMArena, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(bmMStandard, iters) { BENCHMARK(bmMStandard, iters) {
using Map = std::map<int, int>; using Map = std::map<int, int>;
...@@ -229,7 +229,7 @@ BENCHMARK(bmMStandard, iters) { ...@@ -229,7 +229,7 @@ BENCHMARK(bmMStandard, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(bmMArena, iters) { BENCHMARK(bmMArena, iters) {
using Map = std::map< using Map = std::map<
...@@ -250,7 +250,7 @@ BENCHMARK(bmMArena, iters) { ...@@ -250,7 +250,7 @@ BENCHMARK(bmMArena, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
} // namespace } // namespace
......
...@@ -53,7 +53,7 @@ BENCHMARK_NAMED_PARAM(addValue, 100x10_1perSec, seconds(100), 10, 1); ...@@ -53,7 +53,7 @@ BENCHMARK_NAMED_PARAM(addValue, 100x10_1perSec, seconds(100), 10, 1);
BENCHMARK_NAMED_PARAM(addValue, 71x5_1perSec, seconds(71), 5, 1); BENCHMARK_NAMED_PARAM(addValue, 71x5_1perSec, seconds(71), 5, 1);
BENCHMARK_NAMED_PARAM(addValue, 1x1_1perSec, seconds(1), 1, 1); BENCHMARK_NAMED_PARAM(addValue, 1x1_1perSec, seconds(1), 1, 1);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(addValue, AllTime_10perSec, seconds(0), 60, 10); BENCHMARK_NAMED_PARAM(addValue, AllTime_10perSec, seconds(0), 60, 10);
BENCHMARK_NAMED_PARAM(addValue, 3600x60_10perSec, seconds(3600), 60, 10); BENCHMARK_NAMED_PARAM(addValue, 3600x60_10perSec, seconds(3600), 60, 10);
...@@ -63,7 +63,7 @@ BENCHMARK_NAMED_PARAM(addValue, 100x10_10perSec, seconds(100), 10, 10); ...@@ -63,7 +63,7 @@ BENCHMARK_NAMED_PARAM(addValue, 100x10_10perSec, seconds(100), 10, 10);
BENCHMARK_NAMED_PARAM(addValue, 71x5_10perSec, seconds(71), 5, 10); BENCHMARK_NAMED_PARAM(addValue, 71x5_10perSec, seconds(71), 5, 10);
BENCHMARK_NAMED_PARAM(addValue, 1x1_10perSec, seconds(1), 1, 10); BENCHMARK_NAMED_PARAM(addValue, 1x1_10perSec, seconds(1), 1, 10);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(addValue, AllTime_100perSec, seconds(0), 60, 100); BENCHMARK_NAMED_PARAM(addValue, AllTime_100perSec, seconds(0), 60, 100);
BENCHMARK_NAMED_PARAM(addValue, 3600x60_100perSec, seconds(3600), 60, 100); BENCHMARK_NAMED_PARAM(addValue, 3600x60_100perSec, seconds(3600), 60, 100);
......
...@@ -35,7 +35,7 @@ BENCHMARK(baton_pingpong_nonblocking, iters) { ...@@ -35,7 +35,7 @@ BENCHMARK(baton_pingpong_nonblocking, iters) {
run_pingpong_test<false, std::atomic>(iters); run_pingpong_test<false, std::atomic>(iters);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(baton_pingpong_emulated_futex_blocking, iters) { BENCHMARK(baton_pingpong_emulated_futex_blocking, iters) {
run_pingpong_test<true, EmulatedFutexAtomic>(iters); run_pingpong_test<true, EmulatedFutexAtomic>(iters);
...@@ -45,7 +45,7 @@ BENCHMARK(baton_pingpong_emulated_futex_nonblocking, iters) { ...@@ -45,7 +45,7 @@ BENCHMARK(baton_pingpong_emulated_futex_nonblocking, iters) {
run_pingpong_test<false, EmulatedFutexAtomic>(iters); run_pingpong_test<false, EmulatedFutexAtomic>(iters);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(posix_sem_pingpong, iters) { BENCHMARK(posix_sem_pingpong, iters) {
sem_t sems[3]; sem_t sems[3];
......
...@@ -446,7 +446,7 @@ static void contendedUse(uint32_t n, int posters, int waiters) { ...@@ -446,7 +446,7 @@ static void contendedUse(uint32_t n, int posters, int waiters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK_NAMED_PARAM(contendedUse, 1_to_1, 1, 1) BENCHMARK_NAMED_PARAM(contendedUse, 1_to_1, 1, 1)
BENCHMARK_NAMED_PARAM(contendedUse, 1_to_4, 1, 4) BENCHMARK_NAMED_PARAM(contendedUse, 1_to_4, 1, 4)
BENCHMARK_NAMED_PARAM(contendedUse, 1_to_32, 1, 32) BENCHMARK_NAMED_PARAM(contendedUse, 1_to_32, 1, 32)
......
...@@ -291,7 +291,7 @@ BENCHMARK(VirtualFunctionCall, iters) { ...@@ -291,7 +291,7 @@ BENCHMARK(VirtualFunctionCall, iters) {
} }
#endif #endif
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
#define BENCH_BASE(...) FB_VA_GLUE(BENCHMARK_NAMED_PARAM, (__VA_ARGS__)) #define BENCH_BASE(...) FB_VA_GLUE(BENCHMARK_NAMED_PARAM, (__VA_ARGS__))
#define BENCH_REL(...) FB_VA_GLUE(BENCHMARK_RELATIVE_NAMED_PARAM, (__VA_ARGS__)) #define BENCH_REL(...) FB_VA_GLUE(BENCHMARK_RELATIVE_NAMED_PARAM, (__VA_ARGS__))
...@@ -309,37 +309,37 @@ static void folly_microlock(size_t numOps, size_t numThreads) { ...@@ -309,37 +309,37 @@ static void folly_microlock(size_t numOps, size_t numThreads) {
runContended<folly::MicroLock>(numOps, numThreads); runContended<folly::MicroLock>(numOps, numThreads);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 1thread, 1) BENCH_BASE(std_mutex, 1thread, 1)
BENCH_REL(folly_microspin, 1thread, 1) BENCH_REL(folly_microspin, 1thread, 1)
BENCH_REL(folly_picospin, 1thread, 1) BENCH_REL(folly_picospin, 1thread, 1)
BENCH_REL(folly_microlock, 1thread, 1) BENCH_REL(folly_microlock, 1thread, 1)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 2thread, 2) BENCH_BASE(std_mutex, 2thread, 2)
BENCH_REL(folly_microspin, 2thread, 2) BENCH_REL(folly_microspin, 2thread, 2)
BENCH_REL(folly_picospin, 2thread, 2) BENCH_REL(folly_picospin, 2thread, 2)
BENCH_REL(folly_microlock, 2thread, 2) BENCH_REL(folly_microlock, 2thread, 2)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 4thread, 4) BENCH_BASE(std_mutex, 4thread, 4)
BENCH_REL(folly_microspin, 4thread, 4) BENCH_REL(folly_microspin, 4thread, 4)
BENCH_REL(folly_picospin, 4thread, 4) BENCH_REL(folly_picospin, 4thread, 4)
BENCH_REL(folly_microlock, 4thread, 4) BENCH_REL(folly_microlock, 4thread, 4)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 8thread, 8) BENCH_BASE(std_mutex, 8thread, 8)
BENCH_REL(folly_microspin, 8thread, 8) BENCH_REL(folly_microspin, 8thread, 8)
BENCH_REL(folly_picospin, 8thread, 8) BENCH_REL(folly_picospin, 8thread, 8)
BENCH_REL(folly_microlock, 8thread, 8) BENCH_REL(folly_microlock, 8thread, 8)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 16thread, 16) BENCH_BASE(std_mutex, 16thread, 16)
BENCH_REL(folly_microspin, 16thread, 16) BENCH_REL(folly_microspin, 16thread, 16)
BENCH_REL(folly_picospin, 16thread, 16) BENCH_REL(folly_picospin, 16thread, 16)
BENCH_REL(folly_microlock, 16thread, 16) BENCH_REL(folly_microlock, 16thread, 16)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 32thread, 32) BENCH_BASE(std_mutex, 32thread, 32)
BENCH_REL(folly_microspin, 32thread, 32) BENCH_REL(folly_microspin, 32thread, 32)
BENCH_REL(folly_picospin, 32thread, 32) BENCH_REL(folly_picospin, 32thread, 32)
BENCH_REL(folly_microlock, 32thread, 32) BENCH_REL(folly_microlock, 32thread, 32)
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCH_BASE(std_mutex, 64thread, 64) BENCH_BASE(std_mutex, 64thread, 64)
BENCH_REL(folly_microspin, 64thread, 64) BENCH_REL(folly_microspin, 64thread, 64)
BENCH_REL(folly_picospin, 64thread, 64) BENCH_REL(folly_picospin, 64thread, 64)
......
...@@ -868,7 +868,7 @@ BENCHMARK(st_qpahm_find, iters) { ...@@ -868,7 +868,7 @@ BENCHMARK(st_qpahm_find, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(mt_ahm_miss, iters) { BENCHMARK(mt_ahm_miss, iters) {
CHECK_LE(iters, FLAGS_numBMElements); CHECK_LE(iters, FLAGS_numBMElements);
......
...@@ -36,7 +36,7 @@ BENCHMARK(bmRepeatedFun, n) { ...@@ -36,7 +36,7 @@ BENCHMARK(bmRepeatedFun, n) {
fun(); fun();
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(gun) { BENCHMARK(gun) {
static double x = 1; static double x = 1;
...@@ -44,7 +44,7 @@ BENCHMARK(gun) { ...@@ -44,7 +44,7 @@ BENCHMARK(gun) {
doNotOptimizeAway(x); doNotOptimizeAway(x);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(optimizerCanDiscardTrivial, n) { BENCHMARK(optimizerCanDiscardTrivial, n) {
long x = 0; long x = 0;
...@@ -240,7 +240,7 @@ BENCHMARK(optimizerDisabled1NonTrivialPtr, n) { ...@@ -240,7 +240,7 @@ BENCHMARK(optimizerDisabled1NonTrivialPtr, n) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(baselinevector) { BENCHMARK(baselinevector) {
vector<int> v; vector<int> v;
...@@ -261,13 +261,13 @@ BENCHMARK_RELATIVE(bmVector) { ...@@ -261,13 +261,13 @@ BENCHMARK_RELATIVE(bmVector) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(superslow) { BENCHMARK(superslow) {
sleep(1); sleep(1);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(noMulti) { BENCHMARK(noMulti) {
fun(); fun();
......
...@@ -174,19 +174,19 @@ void NoOverflowSub(size_t iterations, ValueT kMin, ValueT kMax) { ...@@ -174,19 +174,19 @@ void NoOverflowSub(size_t iterations, ValueT kMin, ValueT kMax) {
std::numeric_limits<ValueT>::max()) std::numeric_limits<ValueT>::max())
GENERATE_BENCHMARKS_FOR_TYPE(int8_t); GENERATE_BENCHMARKS_FOR_TYPE(int8_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(uint8_t); GENERATE_BENCHMARKS_FOR_TYPE(uint8_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(int16_t); GENERATE_BENCHMARKS_FOR_TYPE(int16_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(uint16_t); GENERATE_BENCHMARKS_FOR_TYPE(uint16_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(int32_t); GENERATE_BENCHMARKS_FOR_TYPE(int32_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(uint32_t); GENERATE_BENCHMARKS_FOR_TYPE(uint32_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(int64_t); GENERATE_BENCHMARKS_FOR_TYPE(int64_t);
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
GENERATE_BENCHMARKS_FOR_TYPE(uint64_t); GENERATE_BENCHMARKS_FOR_TYPE(uint64_t);
int main(int argc, char** argv) { int main(int argc, char** argv) {
......
...@@ -50,7 +50,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_test, iters) { ...@@ -50,7 +50,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_test, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(exception_ptr_create_and_test_concurrent, iters) { BENCHMARK(exception_ptr_create_and_test_concurrent, iters) {
std::atomic<bool> go(false); std::atomic<bool> go(false);
...@@ -96,7 +96,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_test_concurrent, iters) { ...@@ -96,7 +96,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_test_concurrent, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
/* /*
* Use case 2: Library wraps errors in either exception_wrapper or * Use case 2: Library wraps errors in either exception_wrapper or
...@@ -134,8 +134,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_cast, iters) { ...@@ -134,8 +134,7 @@ BENCHMARK_RELATIVE(exception_wrapper_create_and_cast, iters) {
} }
} }
BENCHMARK_DRAW_LINE();
BENCHMARK_DRAW_LINE()
BENCHMARK(exception_ptr_create_and_throw_concurrent, iters) { BENCHMARK(exception_ptr_create_and_throw_concurrent, iters) {
std::atomic<bool> go(false); std::atomic<bool> go(false);
......
...@@ -56,7 +56,7 @@ BENCHMARK_RELATIVE(octal_uintToOctal, iters) { ...@@ -56,7 +56,7 @@ BENCHMARK_RELATIVE(octal_uintToOctal, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(hex_snprintf, iters) { BENCHMARK(hex_snprintf, iters) {
while (iters--) { while (iters--) {
...@@ -72,7 +72,7 @@ BENCHMARK_RELATIVE(hex_uintToHex, iters) { ...@@ -72,7 +72,7 @@ BENCHMARK_RELATIVE(hex_uintToHex, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(intAppend_snprintf) { BENCHMARK(intAppend_snprintf) {
fbstring out; fbstring out;
...@@ -96,7 +96,7 @@ BENCHMARK_RELATIVE(intAppend_format) { ...@@ -96,7 +96,7 @@ BENCHMARK_RELATIVE(intAppend_format) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
template <size_t... Indexes> template <size_t... Indexes>
int snprintf20Numbers(int i, std::index_sequence<Indexes...>) { int snprintf20Numbers(int i, std::index_sequence<Indexes...>) {
...@@ -148,7 +148,7 @@ BENCHMARK_RELATIVE(bigFormat_format, iters) { ...@@ -148,7 +148,7 @@ BENCHMARK_RELATIVE(bigFormat_format, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(format_nested_strings, iters) { BENCHMARK(format_nested_strings, iters) {
BenchmarkSuspender suspender; BenchmarkSuspender suspender;
...@@ -198,7 +198,7 @@ BENCHMARK_RELATIVE(format_nested_direct, iters) { ...@@ -198,7 +198,7 @@ BENCHMARK_RELATIVE(format_nested_direct, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(copy_short_string, iters) { BENCHMARK(copy_short_string, iters) {
BenchmarkSuspender suspender; BenchmarkSuspender suspender;
...@@ -245,7 +245,7 @@ BENCHMARK_RELATIVE(sformat_short_string_safe, iters) { ...@@ -245,7 +245,7 @@ BENCHMARK_RELATIVE(sformat_short_string_safe, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(copy_long_string, iters) { BENCHMARK(copy_long_string, iters) {
BenchmarkSuspender suspender; BenchmarkSuspender suspender;
......
...@@ -45,7 +45,7 @@ BENCHMARK_RELATIVE(ipv4_to_fully_qualified, iters) { ...@@ -45,7 +45,7 @@ BENCHMARK_RELATIVE(ipv4_to_fully_qualified, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(ipv4_to_fully_qualified_port, iters) { BENCHMARK(ipv4_to_fully_qualified_port, iters) {
IPAddressV4 ip("255.255.255.255"); IPAddressV4 ip("255.255.255.255");
...@@ -69,7 +69,7 @@ BENCHMARK_RELATIVE(ipv4_append_to_fully_qualified_port, iters) { ...@@ -69,7 +69,7 @@ BENCHMARK_RELATIVE(ipv4_append_to_fully_qualified_port, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(ipv6_to_string_inet_ntop, iters) { BENCHMARK(ipv6_to_string_inet_ntop, iters) {
IPAddressV6 ipv6Addr("F1E0:0ACE:FB94:7ADF:22E8:6DE6:9672:3725"); IPAddressV6 ipv6Addr("F1E0:0ACE:FB94:7ADF:22E8:6DE6:9672:3725");
...@@ -92,7 +92,7 @@ BENCHMARK_RELATIVE(ipv6_to_fully_qualified, iters) { ...@@ -92,7 +92,7 @@ BENCHMARK_RELATIVE(ipv6_to_fully_qualified, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(ipv6_to_fully_qualified_port, iters) { BENCHMARK(ipv6_to_fully_qualified_port, iters) {
IPAddressV6 ip("F1E0:0ACE:FB94:7ADF:22E8:6DE6:9672:3725"); IPAddressV6 ip("F1E0:0ACE:FB94:7ADF:22E8:6DE6:9672:3725");
...@@ -116,7 +116,7 @@ BENCHMARK_RELATIVE(ipv6_append_to_fully_qualified_port, iters) { ...@@ -116,7 +116,7 @@ BENCHMARK_RELATIVE(ipv6_append_to_fully_qualified_port, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(ipv6_ctor_valid, iters) { BENCHMARK(ipv6_ctor_valid, iters) {
while (iters--) { while (iters--) {
...@@ -140,7 +140,7 @@ BENCHMARK_RELATIVE(ipv6_ctor_invalid, iters) { ...@@ -140,7 +140,7 @@ BENCHMARK_RELATIVE(ipv6_ctor_invalid, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(ipv6_try_from_string_valid, iters) { BENCHMARK(ipv6_try_from_string_valid, iters) {
while (iters--) { while (iters--) {
......
This diff is collapsed.
...@@ -226,7 +226,7 @@ BENCHMARK(scope_guard_lambda_local_var, iters) { ...@@ -226,7 +226,7 @@ BENCHMARK(scope_guard_lambda_local_var, iters) {
CHECK_EQ(iters / 2, count); CHECK_EQ(iters / 2, count);
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(throw_exception, iters) { BENCHMARK(throw_exception, iters) {
for (size_t n = 0; n < iters; ++n) { for (size_t n = 0; n < iters; ++n) {
...@@ -289,7 +289,7 @@ BENCHMARK(return_code_noexcept, iters) { ...@@ -289,7 +289,7 @@ BENCHMARK(return_code_noexcept, iters) {
} }
} }
BENCHMARK_DRAW_LINE() BENCHMARK_DRAW_LINE();
BENCHMARK(std_function_create_move_invoke, iters) { BENCHMARK(std_function_create_move_invoke, iters) {
LargeClass a; LargeClass a;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment