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 [email protected]
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
