census-instrumentation / opencensus-csharp

Distributed tracing and stats collecting framework
https://opencensus.io
Apache License 2.0
139 stars 32 forks source link

Improve performance of CurrentStatsState #30

Closed ndrwrbgs closed 5 years ago

ndrwrbgs commented 6 years ago

Motivation: Performance User impact: None/Hypothetical

Oops, that wasn't meant to make it in as-is, mostly just to demonstrate the problem with the test :)

RE: #29, a lock is being taken for every read. We should investigate alternative methods as the type has the concurrency properties of being unlikely to be written to frequently (in fact, it's disallowed) and being likely to be read more than it is written. Perhaps ReaderWriterLock would be sufficient here.

SergeyKanzhelev commented 5 years ago

this will be addressed in OpenTelemetry project