acelyc111 commented on issue #4522:
URL: 
https://github.com/apache/incubator-doris/issues/4522#issuecomment-685774330


   IntCounter which use CoreLocalValue as underlayer storage seems not faster 
than IntAtomicCounter both in single thread and multi-threads, according to 
unit test's output on my machine:
   ```
   $ ./be/ut_build_ASAN/test/util/new_metrics_test 
--gtest_filter=MetricsTest.CounterPerf
   Note: Google Test filter = MetricsTest.CounterPerf
   [==========] Running 1 test from 1 test case.
   [----------] Global test environment set-up.
   [----------] 1 test from MetricsTest
   [ RUN      ] MetricsTest.CounterPerf
   WARNING: Logging before InitGoogleLogging() is written to STDERR
   I0902 14:26:44.512341  4689 new_metrics_test.cpp:96] int64_t: elapsed: 
1142674345ns, ns/iter:11
   I0902 14:26:50.255072  4689 new_metrics_test.cpp:109] IntAtomicCounter: 
elapsed: 5742505397ns, ns/iter:57
   I0902 14:27:04.972180  4689 new_metrics_test.cpp:122] IntCounter: elapsed: 
14716364303ns, ns/iter:147
   I0902 14:27:09.090067  4689 new_metrics_test.cpp:137] IntCounter 
multi-thread elapsed: 24468952527ns, ns/iter:3058
   I0902 14:27:11.290076  4689 new_metrics_test.cpp:152] IntAtomicCounter 
multi-thread elapsed: 9109052472ns, ns/iter:1138
   [       OK ] MetricsTest.CounterPerf (27921 ms)
   [----------] 1 test from MetricsTest (27921 ms total)
   
   [----------] Global test environment tear-down
   [==========] 1 test from 1 test case ran. (27921 ms total)
   [  PASSED  ] 1 test.
   ```
   So, can we use IntAtomicCounter instead of IntCounter?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to