forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing: add
startSpanFast
for optimized path when disabled
This change attempts to reduce the impact of `StartSpanCtx` when called with tracing disabled. A new fast path is introduced via the `spanSpanFast` method which avoids the more complex logic within `startSpanGeneric`. Additionally, the regexp-based verbose tracing is modified to use an atomic pointer instead of a mutex, and the `SpanOption` iterator is modified to avoid extra copies. Stats for the disabled tracing benchmark: Before: ``` BenchmarkStartSpan/start_span:_1 100000 29.30 ns/op 0 B/op 0 allocs/op ``` After: ``` BenchmarkStartSpan/start_span:_1 100000 18.89 ns/op 0 B/op 0 allocs/op ``` Part of: cockroachdb#133307 Release note: None
- Loading branch information
1 parent
b66cbef
commit b685ba5
Showing
2 changed files
with
71 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters