// Simple code to test the performance (to guide changes) use curve_sampling::Sampling; // baseline: 0:02.24elapsed // 2.05user 0.02system 0:02.08elapsed 99%CPU (18644maxresident)k // 2.12user 0.02system 0:02.15elapsed 99%CPU (18660maxresident)k // 2.01user 0.02system 0:02.04elapsed 99%CPU (18608maxresident)k // 5000 // 6.09user 0.03system 0:06.12elapsed 99%CPU (18664maxresident)k // 6.00user 0.01system 0:06.02elapsed 99%CPU (18564maxresident)k // Fibonacci: // 1.98user 0.03system 0:02.02elapsed 99%CPU (18572maxresident)k // 2.04user 0.00system 0:02.04elapsed 100%CPU (18556maxresident)k // 2.01user 0.01system 0:02.03elapsed 99%CPU (18564maxresident)k // 5000 // 5.90user 0.03system 0:05.93elapsed 99%CPU (18552maxresident)k // 5.84user 0.02system 0:05.90elapsed 99%CPU (18564maxresident)k // 6.01user 0.03system 0:06.05elapsed 99%CPU (18556maxresident)k // 5.71user 0.02system 0:05.73elapsed 99%CPU (18572maxresident)k // approx_priority_queue // 5000 // 3.26user 0.01system 0:03.29elapsed 99%CPU (18664maxresident)k // 3.16user 0.02system 0:03.19elapsed 99%CPU (18576maxresident)k // 3.77user 0.12system 0:03.74elapsed 103%CPU (138008maxresident)k // 3.15user 0.01system 0:03.18elapsed 99%CPU (18664maxresident)k fn main() { let mut b = false; for n in 10 .. 5_000 { let s = Sampling::fun(|x| x.sin(), 0., 10.) .n(n).build(); b &= s.is_empty(); } println!("{b}") }