apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.41k stars 3.96k forks source link

remove LOCK and CAS in bvar counter #2675

Open oathdruid opened 3 months ago

oathdruid commented 3 months ago

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?) bvar::detail::AgentCombiner use LOCK or CAS operation as a general implementation for counter. But when look into specific counters like Adder/Maxer/IntRecorder/LatencyRecorder, the LOCK or CAS operation may be avoidable.

Describe the solution you'd like (描述你期望的解决方法) some method demonstrated here: use-counter-with-bvar

Describe alternatives you've considered (描述你想到的折衷方案)

Additional context/screenshots (更多上下文/截图)