diff options
Diffstat (limited to 'vendor/tracing/benches/span_fields.rs')
-rw-r--r-- | vendor/tracing/benches/span_fields.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/tracing/benches/span_fields.rs b/vendor/tracing/benches/span_fields.rs new file mode 100644 index 000000000..5ad828982 --- /dev/null +++ b/vendor/tracing/benches/span_fields.rs @@ -0,0 +1,23 @@ +use criterion::{criterion_group, criterion_main, Criterion}; +use tracing::{span, Level}; + +mod shared; + +fn bench(c: &mut Criterion) { + shared::for_all_recording(&mut c.benchmark_group("span_fields"), |b| { + b.iter(|| { + let span = span!( + Level::TRACE, + "span", + foo = "foo", + bar = "bar", + baz = 3, + quuux = tracing::field::debug(0.99) + ); + criterion::black_box(span) + }) + }); +} + +criterion_group!(benches, bench); +criterion_main!(benches); |