use ms_toollib::{laymine_solvable_thread, laymine_solvable, laymine, laymine_op, cal_bbbv}; #[macro_use] extern crate bencher; use bencher::Bencher; // 测试高级3BV抽样算法性能 // cargo bench --bench lay_mine fn bench_laymine(bencher: &mut Bencher) { bencher.iter(|| laymine(16, 30, 99, 8, 15)); } // 11,000 ns/iter fn bench_laymine_op(bencher: &mut Bencher) { bencher.iter(|| laymine_op(16, 30, 99, 8, 15)); } // 11,991 ns/iter fn bench_cal_bbbv(bencher: &mut Bencher) { bencher.iter(|| cal_bbbv(&vec![ vec![-1,2,2,-1,2,1,1,1,-1,-1,-1,3,1,0,1,1,2,1,1,1,1,1,0,1,-1,3,-1,1,1,1], vec![1,3,-1,4,3,-1,1,1,2,5,-1,-1,2,1,2,-1,3,-1,2,2,-1,1,0,1,3,-1,4,2,1,-1], vec![0,2,-1,-1,2,2,2,1,1,3,-1,4,-1,1,2,-1,4,2,3,-1,2,1,0,0,2,-1,-1,2,3,3], vec![1,3,3,3,1,1,-1,1,1,-1,2,2,1,2,2,2,2,-1,3,2,1,0,1,1,3,3,3,2,-1,-1], vec![-1,2,-1,1,0,1,1,2,2,2,1,0,0,2,-1,2,1,2,-1,2,1,1,1,-1,2,-1,2,2,5,-1], vec![1,2,1,1,0,0,0,1,-1,2,2,2,1,2,-1,2,0,1,1,3,-1,3,2,2,2,1,2,-1,3,-1], vec![0,1,1,1,1,1,1,1,1,2,-1,-1,3,2,2,1,0,0,0,2,-1,3,-1,2,2,2,2,2,3,2], vec![1,2,-1,2,2,-1,1,0,0,2,4,-1,4,-1,2,0,0,0,0,1,1,2,2,3,-1,-1,2,3,-1,2], vec![3,-1,4,3,-1,2,1,1,1,2,-1,2,4,-1,3,0,0,0,0,0,0,1,2,-1,3,3,-1,3,-1,3], vec![-1,-1,-1,4,2,2,0,1,-1,2,1,1,2,-1,2,0,0,0,0,1,1,2,-1,3,2,1,1,2,2,-1], vec![2,4,-1,3,-1,1,0,1,1,1,0,0,1,1,1,0,0,1,1,2,-1,2,2,-1,1,0,0,1,2,2], vec![0,1,1,2,1,1,1,1,1,0,0,0,1,1,2,2,3,4,-1,4,2,2,2,3,4,2,1,1,-1,1], vec![0,0,0,0,1,1,2,-1,1,0,0,0,1,-1,2,-1,-1,-1,-1,4,-1,2,2,-1,-1,-1,4,3,2,1], vec![0,0,0,0,1,-1,2,1,1,0,0,1,2,3,3,5,-1,7,-1,4,1,2,-1,3,5,-1,-1,-1,2,0], vec![1,1,0,0,1,1,1,0,0,0,0,1,-1,2,-1,5,-1,5,-1,3,1,1,1,1,2,-1,5,-1,2,0], vec![-1,1,0,0,0,0,0,0,0,0,0,1,1,2,2,-1,-1,3,2,-1,1,0,0,0,1,1,2,1,1,0], ])); // 162 } // 11,269 ns/iter benchmark_group!(lay_mine, bench_laymine, bench_laymine_op, bench_cal_bbbv); benchmark_main!(lay_mine);