Enable bench and fix upload-perf
This commit is contained in:
parent
35e6343d61
commit
6cdbdfbbcb
|
@ -3,6 +3,7 @@ extern crate bincode;
|
|||
extern crate rand;
|
||||
extern crate rayon;
|
||||
extern crate solana;
|
||||
extern crate solana_program_interface;
|
||||
extern crate test;
|
||||
|
||||
use rand::{thread_rng, Rng};
|
||||
|
@ -11,11 +12,11 @@ use solana::bank::Bank;
|
|||
use solana::banking_stage::{BankingStage, NUM_THREADS};
|
||||
use solana::entry::Entry;
|
||||
use solana::mint::Mint;
|
||||
use solana::packet::{to_packets_chunked, PacketRecycler};
|
||||
use solana::pubkey::Pubkey;
|
||||
use solana::packet::to_packets_chunked;
|
||||
use solana::signature::{KeypairUtil, Signature};
|
||||
use solana::system_transaction::SystemTransaction;
|
||||
use solana::transaction::Transaction;
|
||||
use solana_program_interface::pubkey::Pubkey;
|
||||
use std::iter;
|
||||
use std::sync::mpsc::{channel, Receiver};
|
||||
use std::sync::Arc;
|
||||
|
@ -47,7 +48,6 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
|
|||
let mint = Mint::new(mint_total);
|
||||
|
||||
let (verified_sender, verified_receiver) = channel();
|
||||
let packet_recycler = PacketRecycler::default();
|
||||
let bank = Arc::new(Bank::new(&mint));
|
||||
let dummy = Transaction::system_move(
|
||||
&mint.keypair(),
|
||||
|
@ -91,10 +91,10 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
|
|||
assert!(r.is_ok(), "sanity parallel execution");
|
||||
}
|
||||
bank.clear_signatures();
|
||||
let verified: Vec<_> = to_packets_chunked(&packet_recycler, &transactions.clone(), 192)
|
||||
let verified: Vec<_> = to_packets_chunked(&transactions.clone(), 192)
|
||||
.into_iter()
|
||||
.map(|x| {
|
||||
let len = x.read().packets.len();
|
||||
let len = x.read().unwrap().packets.len();
|
||||
(x, iter::repeat(1).take(len).collect())
|
||||
}).collect();
|
||||
let (_stage, signal_receiver) =
|
||||
|
|
|
@ -4,7 +4,6 @@ extern crate test;
|
|||
|
||||
use solana::hash::{hash, Hash};
|
||||
use solana::ledger::{next_entries, reconstruct_entries_from_blobs, Block};
|
||||
use solana::packet::BlobRecycler;
|
||||
use solana::signature::{Keypair, KeypairUtil};
|
||||
use solana::system_transaction::SystemTransaction;
|
||||
use solana::transaction::Transaction;
|
||||
|
@ -19,9 +18,8 @@ fn bench_block_to_blobs_to_block(bencher: &mut Bencher) {
|
|||
let transactions = vec![tx0; 10];
|
||||
let entries = next_entries(&zero, 1, transactions);
|
||||
|
||||
let blob_recycler = BlobRecycler::default();
|
||||
bencher.iter(|| {
|
||||
let blobs = entries.to_blobs(&blob_recycler);
|
||||
let blobs = entries.to_blobs();
|
||||
assert_eq!(reconstruct_entries_from_blobs(blobs).unwrap(), entries);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ extern crate rayon;
|
|||
extern crate solana;
|
||||
extern crate test;
|
||||
|
||||
use solana::packet::{to_packets, PacketRecycler};
|
||||
use solana::packet::to_packets;
|
||||
use solana::sigverify;
|
||||
use solana::system_transaction::test_tx;
|
||||
use test::Bencher;
|
||||
|
@ -14,8 +14,7 @@ fn bench_sigverify(bencher: &mut Bencher) {
|
|||
let tx = test_tx();
|
||||
|
||||
// generate packet vector
|
||||
let packet_recycler = PacketRecycler::default();
|
||||
let batches = to_packets(&packet_recycler, &vec![tx; 128]);
|
||||
let batches = to_packets(&vec![tx; 128]);
|
||||
|
||||
// verify packets
|
||||
bencher.iter(|| {
|
||||
|
|
|
@ -4,11 +4,11 @@ steps:
|
|||
env:
|
||||
CARGO_TARGET_CACHE_NAME: "stable"
|
||||
timeout_in_minutes: 30
|
||||
# - command: "ci/docker-run.sh solanalabs/rust-nightly ci/test-bench.sh"
|
||||
# name: "bench [public]"
|
||||
# env:
|
||||
# CARGO_TARGET_CACHE_NAME: "nightly"
|
||||
# timeout_in_minutes: 30
|
||||
- command: "ci/docker-run.sh solanalabs/rust-nightly ci/test-bench.sh"
|
||||
name: "bench [public]"
|
||||
env:
|
||||
CARGO_TARGET_CACHE_NAME: "nightly"
|
||||
timeout_in_minutes: 30
|
||||
- command: "ci/shellcheck.sh"
|
||||
name: "shellcheck [public]"
|
||||
timeout_in_minutes: 20
|
||||
|
|
|
@ -10,6 +10,8 @@ _() {
|
|||
"$@"
|
||||
}
|
||||
|
||||
set -o pipefail
|
||||
|
||||
BENCH_FILE=bench_output.log
|
||||
_ cargo bench --features=unstable --verbose -- -Z unstable-options --format=json | tee $BENCH_FILE
|
||||
_ cargo run --release --bin solana-upload-perf -- $BENCH_FILE
|
||||
|
|
|
@ -35,7 +35,7 @@ fn main() {
|
|||
let median = v["median"].to_string().parse().unwrap();
|
||||
let deviation = v["deviation"].to_string().parse().unwrap();
|
||||
metrics::submit(
|
||||
influxdb::Point::new(&v["name"].to_string())
|
||||
influxdb::Point::new(&v["name"].as_str().unwrap().trim_matches('\"'))
|
||||
.add_field("median", influxdb::Value::Integer(median))
|
||||
.add_field("deviation", influxdb::Value::Integer(deviation))
|
||||
.add_field(
|
||||
|
|
Loading…
Reference in New Issue