XiaoMi / rdsn

Has been migrated to https://github.com/apache/incubator-pegasus/tree/master/rdsn
Other
144 stars 58 forks source link

feat: implement long adder to optimize the counter of new metrics system #1033

Closed empiredan closed 2 years ago

empiredan commented 2 years ago

https://github.com/apache/incubator-pegasus/issues/889

Smityz commented 2 years ago

LGTM

Smityz commented 2 years ago

Can you construct a benchmark for its performance compared with the origin perf_counter?

empiredan commented 2 years ago

Can you construct a benchmark for its performance compared with the origin perf_counter?

Actually the benchmark given in https://github.com/apache/incubator-pegasus/issues/889 has involved the comparison with the original perf-counter: divided_long_adder is nearly the same with the original dsn::perf_counter_number_atomic except that its virtual functions are removed since other long adders also have no virtual function.

The implementation of divided_long_adder can be found in src/utils/long_adder_bench/long_adder_bench.cpp.

acelyc111 commented 2 years ago

What's th difference between this PR's implemention and the original https://github.com/apache/kudu/blob/master/src/kudu/util/striped64.h?

empiredan commented 2 years ago

What's th difference between this PR's implemention and the original https://github.com/apache/kudu/blob/master/src/kudu/util/striped64.h?

The data structures and algorithms between both striped long adder are based on striped64. The differences are: