bitmap search
authorDave Watson <davejwatson@fb.com>
Thu, 18 Aug 2016 15:38:22 +0000 (08:38 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Thu, 18 Aug 2016 15:53:30 +0000 (08:53 -0700)
commit060485b60d9dc7fbada6b17f11dd2dbb63873b5e
tree11303da3429abfa18007a8391387c354065fbb5b
parent9880573b49ab0e36b1d110b5530d4d8f2b56ecfa
bitmap search

Summary:
Use a bitmap search to find the next wheel timer tick instead of a linear scan.
Need to store the current bitmap bit in the individual timeout to support cancellation.

Given the WHEEL_SIZE of 256, this will reduce to 4 ffsl/cmov instructions.

Reviewed By: yfeldblum

Differential Revision: D3637116

fbshipit-source-id: 1a37e19a5342604ec81735eaf85b72b6f673ea1e
folly/io/async/HHWheelTimer.cpp
folly/io/async/HHWheelTimer.h