We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c9385c commit 1123738Copy full SHA for 1123738
opentelemetry/benches/attributes.rs
@@ -40,6 +40,12 @@ fn attributes_creation(c: &mut Criterion) {
40
});
41
42
43
+ c.bench_function("CreateTupleKeyValueUsingGenerics", |b| {
44
+ b.iter(|| {
45
+ let _v1 = black_box(no_op("attribute1", "value1"));
46
+ });
47
48
+
49
#[allow(clippy::useless_vec)]
50
c.bench_function("CreateOtelKeyValueVector", |b| {
51
b.iter(|| {
@@ -65,6 +71,17 @@ fn attributes_creation(c: &mut Criterion) {
65
71
66
72
}
67
73
74
75
+trait OTelValueType {}
76
77
+impl OTelValueType for u32 {}
78
79
+impl OTelValueType for &str {}
80
81
+fn no_op<T : OTelValueType>(key: &'static str, value: T) {
82
+ black_box("test");
83
+}
84
68
85
criterion_group!(benches, criterion_benchmark);
69
86
70
87
criterion_main!(benches);
0 commit comments