Run benchmarks in nightly
And name functions the same way as test functions
This commit is contained in:
parent
af4e95ae0f
commit
8d26be8b89
|
@ -8,5 +8,6 @@ cargo --version
|
|||
rustup component add rustfmt-preview
|
||||
cargo build --verbose --features unstable
|
||||
cargo test --verbose --features unstable
|
||||
cargo bench --verbose --features unstable
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -581,7 +581,7 @@ mod bench {
|
|||
use signature::KeyPairUtil;
|
||||
|
||||
#[bench]
|
||||
fn process_verified_transaction_bench(bencher: &mut Bencher) {
|
||||
fn bench_process_verified_transaction(bencher: &mut Bencher) {
|
||||
let mint = Mint::new(100_000_000);
|
||||
let bank = Bank::new(&mint);
|
||||
// Create transactions between unrelated parties.
|
||||
|
|
|
@ -192,7 +192,7 @@ impl BankingStage {
|
|||
// use transaction::Transaction;
|
||||
//
|
||||
// #[bench]
|
||||
// fn process_transactions_bench(_bencher: &mut Bencher) {
|
||||
// fn bench_process_transactions(_bencher: &mut Bencher) {
|
||||
// let mint = Mint::new(100_000_000);
|
||||
// let bank = Bank::new(&mint);
|
||||
// // Create transactions between unrelated parties.
|
||||
|
@ -260,7 +260,7 @@ mod bench {
|
|||
use transaction::Transaction;
|
||||
|
||||
#[bench]
|
||||
fn stage_bench(bencher: &mut Bencher) {
|
||||
fn bench_stage(bencher: &mut Bencher) {
|
||||
let tx = 100_usize;
|
||||
let mint = Mint::new(1_000_000_000);
|
||||
let pubkey = KeyPair::new().pubkey();
|
||||
|
|
|
@ -197,7 +197,7 @@ mod bench {
|
|||
use ledger::*;
|
||||
|
||||
#[bench]
|
||||
fn next_entries_bench(bencher: &mut Bencher) {
|
||||
fn bench_next_entries(bencher: &mut Bencher) {
|
||||
let start_hash = Hash::default();
|
||||
let entries = next_entries(&start_hash, 10_000, vec![vec![]; 8]);
|
||||
bencher.iter(|| {
|
||||
|
|
|
@ -537,7 +537,8 @@ mod bench {
|
|||
}
|
||||
})
|
||||
}
|
||||
fn run_streamer_bench() -> Result<()> {
|
||||
|
||||
fn bench_streamer_with_result() -> Result<()> {
|
||||
let read = UdpSocket::bind("127.0.0.1:0")?;
|
||||
read.set_read_timeout(Some(Duration::new(1, 0)))?;
|
||||
|
||||
|
@ -572,8 +573,8 @@ mod bench {
|
|||
Ok(())
|
||||
}
|
||||
#[bench]
|
||||
pub fn streamer_bench(_bench: &mut Bencher) {
|
||||
run_streamer_bench().unwrap();
|
||||
pub fn bench_streamer(_bench: &mut Bencher) {
|
||||
bench_streamer_with_result().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ mod bench {
|
|||
use transaction::*;
|
||||
|
||||
#[bench]
|
||||
fn verify_signatures_bench(bencher: &mut Bencher) {
|
||||
fn bench_verify_signatures(bencher: &mut Bencher) {
|
||||
let alice_keypair = KeyPair::new();
|
||||
let last_id = Hash::default();
|
||||
let transactions: Vec<_> = (0..64)
|
||||
|
|
Loading…
Reference in New Issue