#![feature(test)] extern crate test; use gemachain_perf::packet::to_packets_chunked; use gemachain_perf::recycler::Recycler; use gemachain_perf::sigverify; use gemachain_perf::test_tx::test_tx; use test::Bencher; #[bench] fn bench_sigverify(bencher: &mut Bencher) { let tx = test_tx(); // generate packet vector let mut batches = to_packets_chunked(&std::iter::repeat(tx).take(128).collect::>(), 128); let recycler = Recycler::default(); let recycler_out = Recycler::default(); // verify packets bencher.iter(|| { let _ans = sigverify::ed25519_verify(&mut batches, &recycler, &recycler_out); }) } #[bench] fn bench_get_offsets(bencher: &mut Bencher) { let tx = test_tx(); // generate packet vector let batches = to_packets_chunked(&std::iter::repeat(tx).take(1024).collect::>(), 1024); let recycler = Recycler::default(); // verify packets bencher.iter(|| { let _ans = sigverify::generate_offsets(&batches, &recycler); }) }