Clean up tx_count usage
This commit is contained in:
parent
ae111a131c
commit
e02da9a15a
|
@ -173,16 +173,12 @@ fn generate_txs(
|
||||||
shared_txs: &Arc<RwLock<VecDeque<Vec<Transaction>>>>,
|
shared_txs: &Arc<RwLock<VecDeque<Vec<Transaction>>>>,
|
||||||
id: &KeyPair,
|
id: &KeyPair,
|
||||||
keypairs: &[KeyPair],
|
keypairs: &[KeyPair],
|
||||||
tx_count: i64,
|
|
||||||
last_id: &Hash,
|
last_id: &Hash,
|
||||||
threads: usize,
|
threads: usize,
|
||||||
reclaim: bool,
|
reclaim: bool,
|
||||||
) {
|
) {
|
||||||
println!(
|
let tx_count = keypairs.len();
|
||||||
"Signing transactions... {} (reclaim={})",
|
println!("Signing transactions... {} (reclaim={})", tx_count, reclaim);
|
||||||
tx_count / 2,
|
|
||||||
reclaim
|
|
||||||
);
|
|
||||||
let signing_start = Instant::now();
|
let signing_start = Instant::now();
|
||||||
|
|
||||||
let transactions: Vec<_> = keypairs
|
let transactions: Vec<_> = keypairs
|
||||||
|
@ -198,8 +194,8 @@ fn generate_txs(
|
||||||
|
|
||||||
let duration = signing_start.elapsed();
|
let duration = signing_start.elapsed();
|
||||||
let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos());
|
let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos());
|
||||||
let bsps = (tx_count / 2) as f64 / ns as f64;
|
let bsps = (tx_count) as f64 / ns as f64;
|
||||||
let nsps = ns as f64 / (tx_count / 2) as f64;
|
let nsps = ns as f64 / (tx_count) as f64;
|
||||||
println!(
|
println!(
|
||||||
"Done. {:.2} thousand signatures per second, {:.2} us per signature, {} ms total time",
|
"Done. {:.2} thousand signatures per second, {:.2} us per signature, {} ms total time",
|
||||||
bsps * 1_000_000_f64,
|
bsps * 1_000_000_f64,
|
||||||
|
@ -591,7 +587,6 @@ fn main() {
|
||||||
&shared_txs,
|
&shared_txs,
|
||||||
&id,
|
&id,
|
||||||
&keypairs,
|
&keypairs,
|
||||||
tx_count,
|
|
||||||
&last_id,
|
&last_id,
|
||||||
threads,
|
threads,
|
||||||
reclaim_tokens_back_to_source_account,
|
reclaim_tokens_back_to_source_account,
|
||||||
|
|
Loading…
Reference in New Issue