Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the shared state and the mutex from NVTX internals (#2310)
Until now, raft has stored a map of NVTX colors (annotation -> color) to avoid using the same color for different annotations and keep using the same color for the same annotations. This map is a shared state. During an extensive ANN_BENCH throughput testing it has turned out that the mutex guarding the map can sometimes become a bottleneck when the number of concurrent threads is really large (>~ 256). This PR replaces the unordered map and the mutex guarding it with a deterministic hash value of the annotation instead (which is stateless). **Pros:** - No shared state, no mutexes. - Assigns the same colors to the same annotations across program runs. **Cons:** - Sometimes different annotations can have the same color (hash collisions). Authors: - Artem M. Chirkin (https://github.com/achirkin) Approvers: - Tamas Bela Feher (https://github.com/tfeher) - Corey J. Nolet (https://github.com/cjnolet) URL: #2310
- Loading branch information