benchmarks: add tracing-noop comparison; restructure to produce line graphs #194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I'm a
tracingmaintainer. Overall, I'm really excited to see people working in this space! I have a few disorganized thoughts:minitraceis performing the equivalent of a noop. When I madetracingdo the same thing, I've found thattracingis a little faster than minitrace. When I comparedcompare/Tokio Tracing/1000tocompare/minitrace/1000(after adding a no-optracingsubscriber but before renaming it in this PR, I found thattracingclocked in at 4.7097μs, whileminitraceclocked in at 26.920μs. I'm pretty sure that this can be chalked up to different priorities/approaches, in thatminitraceopts to off-load spans to a background thread by default, whiletracingdoes not.tracing-opentelemetryand the Rustopentelemetrycrates. Removing the usage ofBoxandArcinside ofopentelemetryand having a more efficient Registry intracing-subscribercould go a long way in closing the performance gap you've observed. I'm not even talking about moving span handling/creation into a background thread for tracing-opentelemetry, but that's certainly in the cards to reduce latency.tracingcan ever get there, I think we can make a default level for spans.tracingisn't necessarily treating as its top priority.The structuring of the benchmarks allows for creating line charts like the following:
.
On my M1 Mac, these are the results of me running the benchmarks:
cargo bench --bench compare