• Yedidya Feldblum's avatar
    XLOG_EVERY_N_THREAD · 6c7906af
    Yedidya Feldblum authored
    Summary:
    [Folly] `XLOG_EVERY_N_THREAD`.
    
    Implemented with a single per-thread map for all `XLOG_EVERY_N_THREAD` collectively. This approach has better TLS overhad than a `thread_local` counter per `XLOG_EVERY_N_THREAD`, at the cost of integer-keyed map lookups.
    
    While the `thread_local` counter approach is twice as fast as this approach for a noop log-handler, it is expected that the runtime overhead of real log-handlers will make this type of saving immaterial.
    
    Reviewed By: simpkins, luciang
    
    Differential Revision: D15293529
    
    fbshipit-source-id: 7af535a0d329473126a0e4dcffc19d750e8b8b10
    6c7906af
XlogBench.cpp 4.25 KB