From b692cb2fa27911cbe3d307351cb786a8301f99ef Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Tue, 7 Oct 2014 15:50:32 -0700 Subject: [PATCH] wangle-bench gflags Summary: Because windtunnel quirkloads needs `--json` which is enabled with gflags Test Plan: $ wangle-bench --json { "%hundredThens" : 28133155.113220215, "no_contention" : 4842268655.11322, "%fourThens" : 1495655.1132202148, "%twoThens" : 882311.3632202148, "oneThen" : 581053.5507202148, "-" : 0, "%withThen" : 559830.8944702148, "%promiseAndFuture" : 250840.66009521484, "%contention" : 8074419655.11322, "constantFuture" : 239916.83197021484 } Reviewed By: meisner@fb.com Subscribers: robbert, net-systems@, fugalh, exa, njormrod, davejwatson, jsedgwick FB internal diff: D1601364 Tasks: 5277907 --- folly/wangle/test/Benchmark.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/folly/wangle/test/Benchmark.cpp b/folly/wangle/test/Benchmark.cpp index d88d9b9d..95fcef9f 100644 --- a/folly/wangle/test/Benchmark.cpp +++ b/folly/wangle/test/Benchmark.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -24,6 +25,8 @@ using namespace folly::wangle; using namespace std; +namespace { + template T incr(Try&& t) { return t.value() + 1; @@ -36,6 +39,8 @@ void someThens(size_t n) { } } +} // anonymous namespace + BENCHMARK(constantFuture) { makeFuture(42); } @@ -160,6 +165,8 @@ BENCHMARK_RELATIVE(contention) { producer.join(); } -int main() { +int main(int argc, char** argv) { + gflags::ParseCommandLineFlags(&argc, &argv, true); folly::runBenchmarks(); + return 0; } -- 2.34.1