jonhoo / jonhoo/tracing-timing
Make the fast path take no locks
- Dominant language
- Rust
- Stars
- 136
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Ideally we'd like event recording to not even take the sharded read lock on the fast path. This _should_ be possible by keeping the TLS in some kind of atomic linked list instead of as a map inside the critical state. There are two main challenges with this approach:
- How do we deal with `span::Id` re-use and invalidation? If the writers kept a cache of the state for spans in their TLS, they wouldn't know when that state is out-of-date if a `span::Id` is dropped and then re-created rapidly. We could conceivably switch away from `Slab` and just use a monotonically increasing `u64` as the `span::Id` instead, though it would slow down lookups as they'd now need to navigate a map of some kind.
- It precludes one thread (most likely the one that'll read the histograms) from dropping all the recorders to force synchronization of the histograms. Maybe we're okay forgoing that feature?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.