jonhoo / jonhoo/tracing-timing

Avoid taking write lock on span creation

Open
#4 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
136
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Here's a rough sketch of the idea:

- Use an atomic `Slab` (@hawkw has something brewing) for `span id => group`.
- Use an atomic skiplist of `(group, group state)` for `group => group state`. On a new span, if the group does not exist in the list, try to insert it. If the insert CAS fails, search `idle-recorders` again for the group. If it does not exist, try to add it again. Repeat until successful.

With this, I _believe_ the entire outer lock can go away, as all access should be through `&self`. We may still want to keep it for `force_synchronize` though.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.