| 640 | } |
| 641 | |
| 642 | fn bench_unpack_arithmetic<const FACTOR: usize>(b: &mut Bencher) { |
| 643 | let unpacked_len = 1000; |
| 644 | let packed = pack_arithmetic::<FACTOR>(&vec![0; unpacked_len]); |
| 645 | let mut out = Vec::with_capacity(unpacked_len); |
| 646 | |
| 647 | b.iter(|| { |
| 648 | let mut input = packed.as_slice(); |
| 649 | let input = black_box(&mut input); |
| 650 | let unpacked_len = black_box(unpacked_len); |
| 651 | out.clear(); |
| 652 | super::unpack_arithmetic::<FACTOR>(input, unpacked_len, black_box(&mut out)).unwrap(); |
| 653 | }); |
| 654 | } |
| 655 | |
| 656 | macro_rules! bench_n { |
| 657 | ($bench:ident, $($n:literal),+) => { |