File tree 1 file changed +2
-2
lines changed
opentelemetry-sdk/benches
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ fn growable_array_insertion_benchmark(c: &mut Criterion) {
28
28
fn vec_insertion_benchmark ( c : & mut Criterion ) {
29
29
c. bench_function ( "Vec Insertion" , |b| {
30
30
b. iter ( || {
31
- let mut collection = Vec :: new ( ) ;
31
+ let mut collection = Vec :: with_capacity ( 10 ) ;
32
32
for i in 0 ..8 {
33
33
let key = Key :: from ( format ! ( "key{}" , i) ) ;
34
34
let value = AnyValue :: Int ( i as i64 ) ;
@@ -72,7 +72,7 @@ fn growable_array_get_benchmark(c: &mut Criterion) {
72
72
73
73
fn vec_iteration_benchmark ( c : & mut Criterion ) {
74
74
c. bench_function ( "Vec Iteration" , |b| {
75
- let mut collection = Vec :: new ( ) ;
75
+ let mut collection = Vec :: with_capacity ( 10 ) ;
76
76
for i in 0 ..8 {
77
77
let key = Key :: from ( format ! ( "key{}" , i) ) ;
78
78
let value = AnyValue :: Int ( i as i64 ) ;
You can’t perform that action at this time.
0 commit comments