serial/parallel benchmark
Summary: This is an attempt to see the effect of lock contention in the less-common case where a promise is fulfilled at the same time the future is still being set up. Although this is expected to be off the beaten path, it will still be a good idea to keep an eye on how we improve or worsen perf, when we play with different locking strategies (which I intend to do a lot of in the near term).
Test Plan:
============================================================================
folly/wangle/test/Benchmark.cpp relative time/iter iters/s
============================================================================
constantFuture 249.31ns 4.01M
promiseAndFuture 100.88% 247.13ns 4.05M
withThen 43.87% 568.30ns 1.76M
----------------------------------------------------------------------------
oneThen 569.62ns 1.76M
twoThens 63.46% 897.60ns 1.11M
fourThens 39.64% 1.44us 695.90K
hundredThens 1.91% 29.75us 33.61K
----------------------------------------------------------------------------
serial 4.97ms 201.21
parallel 60.22% 8.25ms 121.18
============================================================================
Reviewed By: jsedgwick@fb.com
Subscribers: meisner, net-systems@, fugalh, exa, njormrod
FB internal diff:
D1593010