summaryrefslogtreecommitdiffstats
path: root/third_party/rust/tracing/benches/enter_span.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/tracing/benches/enter_span.rs')
-rw-r--r--third_party/rust/tracing/benches/enter_span.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/rust/tracing/benches/enter_span.rs b/third_party/rust/tracing/benches/enter_span.rs
new file mode 100644
index 0000000000..757350a539
--- /dev/null
+++ b/third_party/rust/tracing/benches/enter_span.rs
@@ -0,0 +1,16 @@
+use criterion::{criterion_group, criterion_main, Criterion};
+use tracing::{span, Level};
+
+mod shared;
+
+fn bench(c: &mut Criterion) {
+ shared::for_all_dispatches(&mut c.benchmark_group("enter_span"), |b| {
+ let span = span!(Level::TRACE, "span");
+ b.iter(|| {
+ let _span = span.enter();
+ })
+ });
+}
+
+criterion_group!(benches, bench);
+criterion_main!(benches);