Add benchmark for througput of timed_wait with cancelation
Summary: This adds a simple benchmark to measure the throughput of calling `Baton::timed_wait` with later fulfillment of Baton without hitting the timeout. This benchmark is useful to make sure that we don't regress when migrating to HHWheelTimer. It adds 3 case with 1, 5 and 10000 different timeout values used. Below are the results of running the benchmarks: ``` ============================================================================ folly/fibers/test/FibersBenchmark.cpp relative time/iter iters/s ============================================================================ FiberManagerCancelledTimeouts_Single_300 366.57ms 2.73 FiberManagerCancelledTimeouts_Five 365.44ms 2.74 FiberManagerCancelledTimeouts_TenThousand 693.06ms 1.44 ============================================================================ ``` Note, that the 10k case is slower because internally `TimeoutController` has `O(num_timeouts)` loop for looking up the correct queue. Reviewed By: jmswen Differential Revision: D13624361 fbshipit-source-id: 4c2324229f524b55d9cf2371ec2acca35db6f4ff
Showing
Please register or sign in to comment