MCPcopy Create free account
hub / github.com/apache/arrow-rs / array_from_vec_benchmark

Function array_from_vec_benchmark

arrow/benches/array_from.rs:173–207  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

171}
172
173fn 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
209fn gen_option_vector<TItem: Copy>(item: TItem, len: usize) -> Vec<Option<TItem>> {
210 hint::black_box(

Callers

nothing calls this directly

Calls 5

array_from_vecFunction · 0.85
array_string_from_vecFunction · 0.85
struct_array_valuesFunction · 0.85
struct_array_from_vecFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected