Debian Codegraph @

src/uu/factor/benches/factor_bench.rs

raw
1 // This file is part of the uutils coreutils package.
2 //
3 // For the full copyright and license information, please view the LICENSE
4 // file that was distributed with this source code.
5
6 // spell-checker:ignore funcs
7
8 use divan::{Bencher, black_box};
9 use uu_factor::uumain;
10 use uucore::benchmark::run_util_function;
11
12 /// Benchmark multiple u64 digits
13 #[divan::bench(args = [(2)])]
14 fn factor_multiple_u64s(bencher: Bencher, start_num: u64) {
15 bencher
16 // this is a range of 5000 different u128 integers
17 .with_inputs(|| (start_num, start_num + 2500))
18 .bench_values(|(start_u64, end_u64)| {
19 for u64_digit in start_u64..=end_u64 {
20 black_box(run_util_function(uumain, &[&u64_digit.to_string()]));
21 }
22 });
23 }
24
25 fn main() {
26 divan::main();
27 }