Avoid unnecessary looping over bitmap when scheduling new timeouts
Summary: Current implementation will loop over bitmap to figure out next tick to schedule. This consumes visible amount of CPU (10% in fibers benchmark, ~4% of Thrift noop load test). However, this looping is unnecessary, because we already have all information available - what is the earliest pre-existing timeout (expireTick_) and the new one. So we can decide what tick to schedule for by just simple conditional statement. Reviewed By: vitaut Differential Revision: D13709523 fbshipit-source-id: b0e3e6301cc2e759b4e8901ba5ff009587516cf5
Showing
Please register or sign in to comment