MCPcopy Create free account
hub / github.com/dpc/pariter / map_vs_map_parallel_double

Function map_vs_map_parallel_double

src/tests.rs:22–38  ·  view source on GitHub ↗
(v: Vec<usize>, threads: usize, max_in_flight: usize)

Source from the content-addressed store, hash-verified

20
21#[quickcheck]
22fn map_vs_map_parallel_double(v: Vec<usize>, threads: usize, max_in_flight: usize) -> bool {
23 let m: Vec<_> = v.clone().into_iter().map(|x| x / 2).collect();
24 let mp: Vec<_> = v
25 .clone()
26 .into_iter()
27 .parallel_map_custom(
28 |o| o.threads(threads % 32).buffer_size(max_in_flight % 128),
29 |x| x / 2,
30 )
31 .parallel_map_custom(
32 |o| o.threads(threads % 32).buffer_size(max_in_flight % 128),
33 |x| x,
34 )
35 .collect();
36
37 m == mp
38}
39
40#[quickcheck]
41fn map_vs_map_parallel_scoped_double(v: Vec<usize>, threads: usize, max_in_flight: usize) -> bool {

Callers

nothing calls this directly

Calls 3

parallel_map_customMethod · 0.80
buffer_sizeMethod · 0.45
threadsMethod · 0.45

Tested by

no test coverage detected