1 | use criterion::{criterion_group, criterion_main, Criterion}; |
---|---|
2 | use tracing::{span, Level}; |
3 | |
4 | mod shared; |
5 | |
6 | fn bench(c: &mut Criterion) { |
7 | shared::for_all_recording(&mut c.benchmark_group("span_fields"), |b| { |
8 | b.iter(|| { |
9 | let span = span!( |
10 | Level::TRACE, |
11 | "span", |
12 | foo = "foo", |
13 | bar = "bar", |
14 | baz = 3, |
15 | quuux = tracing::field::debug(0.99) |
16 | ); |
17 | criterion::black_box(span) |
18 | }) |
19 | }); |
20 | } |
21 | |
22 | criterion_group!(benches, bench); |
23 | criterion_main!(benches); |
24 |