You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/01/24 04:11:05 UTC

[GitHub] [incubator-pegasus] empiredan commented on issue #889: Feature: implement long adder to optimize the counter of new metrics system

empiredan commented on issue #889:
URL: https://github.com/apache/incubator-pegasus/issues/889#issuecomment-1019698403


   > Through `perf_counter` may not cost lots of time in our flame graph(capture in the read Scenes). ![cp](https://user-images.githubusercontent.com/22953824/150717253-cf425278-6d1d-4d32-975f-f45b93c2cbc6.svg)
   > 
   > I think it's still worth optimizing it.
   
   Thanks for providing such a cool flame graph !
   
   Yeah I think currently most of our tasks that are sampled by the counter will be executed during several milliseconds or more: it may consume lots of memory, and involve network transmission or disk operations. If L1 cache is not large enough, it's likely that the counter has been evicted from L1 cache and must be loaded from memory again. This will not lead to false sharing.
   
   On the other hand, since we will adopt striped_long_adder based on striped64 as the default implementation for the counter, it will reduce the memory usage: a long duration will greatly reduce the possibility of collision, thus a single 8-byte `atomic<int64_t>` is usually enough; by contrast, `dsn::perf_counter_number_atomic` will consume 856 bytes.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org