• Z
    Avoid unnecessary big for-loop when reporting ticker stats stored in GetContext (#3490) · f95a5b24
    Zhongyi Xie 提交于
    Summary:
    Currently in `Version::Get` when reporting ticker stats stored in `GetContext`, there is a big for-loop through all `Ticker` which adds unnecessary cost to overall CPU usage. We can optimize by storing only ticker values that are used in `Get()` calls in a new struct `GetContextStats` since only a small fraction of all tickers are used in `Get()` calls. For comparison, with the new approach we only need to visit 17 values while old approach will require visiting 100+ `Ticker`
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/3490
    
    Differential Revision: D6969154
    
    Pulled By: miasantreble
    
    fbshipit-source-id: fc27072965a3a94125a3e6883d20dafcf5b84029
    f95a5b24
version_set.cc 155.0 KB