brpc icon indicating copy to clipboard operation
brpc copied to clipboard

remove LOCK and CAS in bvar counter

Open oathdruid opened this issue 1 year ago • 2 comments

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 (更多上下文/截图)

oathdruid avatar Jul 02 '24 07:07 oathdruid

Perhaps we can introduce babylon to improve the performance of bvar. Users can choose whether to use bvar with babylon through a switch.

chenBright avatar Jun 11 '25 02:06 chenBright

Related issue: https://github.com/baidu/babylon/issues/89

chenBright avatar Jun 12 '25 03:06 chenBright