Skip to content

Commit 38c8e3c

Browse files
committed
fix: bench too
1 parent 91d6ac3 commit 38c8e3c

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

libdd-profiling/benches/add_samples.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,8 @@ struct Frame2 {
7575

7676
pub fn bench_add_sample_vs_add2(c: &mut Criterion) {
7777
let sample_types = make_sample_types();
78-
79-
// Create dictionary for both sample types and frames
8078
let dict = profiling::profiles::datatypes::ProfilesDictionary::try_new().unwrap();
8179

82-
// Convert sample_types to ValueType2 by inserting strings into dictionary
83-
let sample_types2: Vec<_> = sample_types
84-
.iter()
85-
.map(|st| {
86-
let type_id = dict.try_insert_str2(st.r#type).unwrap();
87-
let unit_id = dict.try_insert_str2(st.unit).unwrap();
88-
api2::ValueType2 { type_id, unit_id }
89-
})
90-
.collect();
91-
9280
// This is root-to-leaf, instead of leaf-to-root. We'll reverse it below.
9381
// Taken from a Ruby app, everything here is source-available.
9482
let mut frames = [
@@ -150,7 +138,7 @@ pub fn bench_add_sample_vs_add2(c: &mut Criterion) {
150138
c.bench_function("profile_add_sample2_frames_x1000", |b| {
151139
b.iter(|| {
152140
let mut profile = profiling::internal::Profile::try_new_with_dictionary(
153-
&sample_types2,
141+
&sample_types,
154142
None,
155143
dict.try_clone().unwrap(),
156144
)

0 commit comments

Comments
 (0)