You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zouyx (GitHub)" <gi...@apache.org> on 2019/12/25 01:33:01 UTC

[GitHub] [dubbo-go] zouyx commented on pull request #278: ftr: Metric support Part1: metric filter, method count, method rt

actually i agree to use sync.Map,   this scene is fit to sync.Map use case as below,i think metricRegistryMap will be a lot of data

>>The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.

Ref: [sync.Map godoc](https://golang.org/pkg/sync/#Map)

[ Full content available at: https://github.com/apache/dubbo-go/pull/278 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org