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

Function struct_array_values

arrow/benches/array_from.rs:47–62  ·  view source on GitHub ↗
(
    n: usize,
)

Source from the content-addressed store, hash-verified

45}
46
47fn struct_array_values(
48 n: usize,
49) -> (
50 &'static str,
51 Vec<Option<&'static str>>,
52 &'static str,
53 Vec<Option<i32>>,
54) {
55 let mut strings: Vec<Option<&str>> = Vec::with_capacity(n);
56 let mut ints: Vec<Option<i32>> = Vec::with_capacity(n);
57 for _ in 0..n / 4 {
58 strings.extend_from_slice(&[Some("joe"), None, None, Some("mark")]);
59 ints.extend_from_slice(&[Some(1), Some(2), None, Some(4)]);
60 }
61 ("f1", strings, "f2", ints)
62}
63
64fn struct_array_from_vec(
65 field1: &str,

Callers 1

array_from_vec_benchmarkFunction · 0.85

Calls 1

extend_from_sliceMethod · 0.80

Tested by

no test coverage detected