Skip to content

Commit

Permalink
[Bench] Fix a few issues in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfind committed Mar 19, 2022
1 parent f7f1a30 commit 3814581
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion network_utils/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl NetworkClient {
if received % 5000 == 0 && received > 0 {
debug!("Received {}", received);
}
let xcontinue = received < total;
let xcontinue = received <= total;
futures::future::ready(xcontinue)
})
.collect()
Expand Down
7 changes: 7 additions & 0 deletions sui/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ fn main() {
benchmark.committee_size,
MIN_COMMITTEE_SIZE
);

let (state, transactions) = benchmark.make_structures();

// Make multi-threaded runtime for the authority
Expand All @@ -114,6 +115,12 @@ fn main() {
} else {
num_cpus::get()
};
if benchmark.benchmark_type == BenchmarkType::TransactionsAndCerts {
assert!(
(benchmark.num_accounts * 2 / connections) % 2 == 0,
"Each tx and their cert must be sent in order. Multiple TCP connections will break requests into chunks, and chunk size must be an even number so it doesn't break each tx and cert pair"
);
}

thread::spawn(move || {
let runtime = Builder::new_multi_thread()
Expand Down

0 comments on commit 3814581

Please sign in to comment.