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

Function create_slices

arrow/benches/mutable_array.rs:29–39  ·  view source on GitHub ↗
(size: usize)

Source from the content-addressed store, hash-verified

27use arrow::{array::*, util::bench_util::create_string_array};
28
29fn create_slices(size: usize) -> Vec<(usize, usize)> {
30 let rng = &mut seedable_rng();
31
32 (0..size)
33 .map(|_| {
34 let start = rng.random_range(0..size / 2);
35 let end = rng.random_range(start + 1..size);
36 (start, end)
37 })
38 .collect()
39}
40
41fn bench<T: Array>(v1: &T, slices: &[(usize, usize)]) {
42 let data = v1.to_data();

Callers 1

add_benchmarkFunction · 0.85

Calls 2

collectMethod · 0.80
seedable_rngFunction · 0.50

Tested by

no test coverage detected