(c: &mut Criterion)
| 171 | } |
| 172 | |
| 173 | fn array_from_vec_benchmark(c: &mut Criterion) { |
| 174 | c.bench_function("array_from_vec 128", |b| b.iter(|| array_from_vec(128))); |
| 175 | c.bench_function("array_from_vec 256", |b| b.iter(|| array_from_vec(256))); |
| 176 | c.bench_function("array_from_vec 512", |b| b.iter(|| array_from_vec(512))); |
| 177 | |
| 178 | c.bench_function("array_string_from_vec 128", |b| { |
| 179 | b.iter(|| array_string_from_vec(128)) |
| 180 | }); |
| 181 | c.bench_function("array_string_from_vec 256", |b| { |
| 182 | b.iter(|| array_string_from_vec(256)) |
| 183 | }); |
| 184 | c.bench_function("array_string_from_vec 512", |b| { |
| 185 | b.iter(|| array_string_from_vec(512)) |
| 186 | }); |
| 187 | |
| 188 | let (field1, strings, field2, ints) = struct_array_values(128); |
| 189 | c.bench_function("struct_array_from_vec 128", |b| { |
| 190 | b.iter(|| struct_array_from_vec(field1, &strings, field2, &ints)) |
| 191 | }); |
| 192 | |
| 193 | let (field1, strings, field2, ints) = struct_array_values(256); |
| 194 | c.bench_function("struct_array_from_vec 256", |b| { |
| 195 | b.iter(|| struct_array_from_vec(field1, &strings, field2, &ints)) |
| 196 | }); |
| 197 | |
| 198 | let (field1, strings, field2, ints) = struct_array_values(512); |
| 199 | c.bench_function("struct_array_from_vec 512", |b| { |
| 200 | b.iter(|| struct_array_from_vec(field1, &strings, field2, &ints)) |
| 201 | }); |
| 202 | |
| 203 | let (field1, strings, field2, ints) = struct_array_values(1024); |
| 204 | c.bench_function("struct_array_from_vec 1024", |b| { |
| 205 | b.iter(|| struct_array_from_vec(field1, &strings, field2, &ints)) |
| 206 | }); |
| 207 | } |
| 208 | |
| 209 | fn gen_option_vector<TItem: Copy>(item: TItem, len: usize) -> Vec<Option<TItem>> { |
| 210 | hint::black_box( |
nothing calls this directly
no test coverage detected