2018-08-22 07:57:07 -07:00
|
|
|
#![feature(test)]
|
2018-08-01 14:10:39 -07:00
|
|
|
extern crate bincode;
|
|
|
|
extern crate rayon;
|
|
|
|
extern crate solana;
|
2018-08-22 07:57:07 -07:00
|
|
|
extern crate test;
|
2018-08-01 14:10:39 -07:00
|
|
|
|
2018-09-24 10:20:58 -07:00
|
|
|
use solana::packet::to_packets;
|
2018-08-01 14:10:39 -07:00
|
|
|
use solana::sigverify;
|
2018-09-26 17:21:43 -07:00
|
|
|
use solana::system_transaction::test_tx;
|
2018-08-22 07:57:07 -07:00
|
|
|
use test::Bencher;
|
2018-08-01 14:10:39 -07:00
|
|
|
|
2018-08-22 07:57:07 -07:00
|
|
|
#[bench]
|
2018-08-09 08:26:21 -07:00
|
|
|
fn bench_sigverify(bencher: &mut Bencher) {
|
2018-08-01 14:10:39 -07:00
|
|
|
let tx = test_tx();
|
|
|
|
|
|
|
|
// generate packet vector
|
2018-09-24 10:20:58 -07:00
|
|
|
let batches = to_packets(&vec![tx; 128]);
|
2018-08-01 14:10:39 -07:00
|
|
|
|
|
|
|
// verify packets
|
|
|
|
bencher.iter(|| {
|
|
|
|
let _ans = sigverify::ed25519_verify(&batches);
|
|
|
|
})
|
|
|
|
}
|