add some benchmarks
authorHans Fugal <fugalh@fb.com>
Thu, 2 Oct 2014 17:39:53 +0000 (10:39 -0700)
committerAndrii Grynenko <andrii@fb.com>
Wed, 15 Oct 2014 00:48:13 +0000 (17:48 -0700)
commitfd81069d72cdf91658f716c3377fcebbb9a52bce
tree623a1d34d4d51c7ca0c97e0c0d27d7ad4ee69ffb
parent30d69c32b8f6952ac5c0f4943ef0c5ddb1917fec
add some benchmarks

Summary: For great speed

Test Plan:
$ fbmake opt && _bin/folly/wangle/wangle-bench
============================================================================
folly/wangle/test/Benchmark.cpp                 relative  time/iter  iters/s
============================================================================
constantFuture                                             235.92ns    4.24M
promiseAndFuture                                 100.37%   235.04ns    4.25M
withThen                                          41.97%   562.17ns    1.78M
----------------------------------------------------------------------------
oneThen                                                    539.03ns    1.86M
twoThens                                          64.01%   842.14ns    1.19M
fourThens                                         39.27%     1.37us  728.62K
hundredThens                                       1.82%    29.63us   33.75K
============================================================================

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, net-systems@, fugalh, exa, njormrod

FB internal diff: D1587871
folly/wangle/test/Benchmark.cpp [new file with mode: 0644]