Replies: 2 comments 3 replies
-
I would just caution us to resist the urge to think that the route to faster performance is ideally started by taking a left turn at |
Beta Was this translation helpful? Give feedback.
-
The gains are coming not purely from use of "atomic" instructions. For example, the f64 version of Number is implemented with plain Mutex locks: https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-sdk/src/metrics/internal/mod.rs#L136-L137 |
Beta Was this translation helpful? Give feedback.
-
I believe, there is an undocumented understanding among contributors of this repo not to use
unsafe
code. However, we can allow it on a case-by-case basis, given the potential benefits in performance and capabilities, with assurance that it won't compromise the memory safety.hashmap
underRWLock
. However, it won't be easy to achieve the same with Histogram aggregation with more complex aggregated values, withoutunsafe
keyword.unsafe
.unsafe
keywork when required. So, the end-users cannot impose restrictions on themselves against using crates with unsafe code for their telemetry pipeline.It is not feasible to implement #1943 or #1942 (adding a shared
LogRecord
pool), so wanted to have a discussion here before further deciding on the design.ps. We do use
unsafe
at one place in opentelemetry-http but I believe it is possible to remove that if we decide against usingunsafe
.Beta Was this translation helpful? Give feedback.
All reactions