• Stepan Palamarchuk's avatar
    Avoid unnecessary looping over bitmap when scheduling new timeouts · 8b47e569
    Stepan Palamarchuk authored
    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
    8b47e569
HHWheelTimer.cpp 10.4 KB