Skip to content

Commit

Permalink
[executor-benchmark] add a bound to uncommitted blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse authored and bors-libra committed Dec 17, 2021
1 parent f7aca29 commit e6122b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion execution/executor-benchmark/benches/executor_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn executor_benchmark<M: Measurement + 'static>(c: &mut Criterion<M>) {
let executor = Arc::new(executor);

let mut generator = TransactionGenerator::new(genesis_key, NUM_ACCOUNTS);
let (commit_tx, _commit_rx) = std::sync::mpsc::channel();
let (commit_tx, _commit_rx) = std::sync::mpsc::sync_channel(50 /* bound */);

let mut executor = TransactionExecutor::new(executor, parent_block_id, 0, Some(commit_tx));
let txns = generator.gen_account_creations(SMALL_BLOCK_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion execution/executor-benchmark/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn run_benchmark(
let executor_2 = executor_1.clone();

let (block_sender, block_receiver) = mpsc::sync_channel(50 /* bound */);
let (commit_sender, commit_receiver) = mpsc::channel();
let (commit_sender, commit_receiver) = mpsc::sync_channel(50 /* bound */);

let mut generator =
TransactionGenerator::new_with_metafile(genesis_key, block_sender, source_dir);
Expand Down
5 changes: 3 additions & 2 deletions execution/executor-benchmark/src/transaction_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ pub struct TransactionExecutor {
start_time: Instant,
version: Version,
// If commit_sender is `None`, we will commit all the execution result immediately in this struct.
commit_sender: Option<mpsc::Sender<(HashValue, HashValue, Instant, Instant, Duration, usize)>>,
commit_sender:
Option<mpsc::SyncSender<(HashValue, HashValue, Instant, Instant, Duration, usize)>>,
}

impl TransactionExecutor {
Expand All @@ -26,7 +27,7 @@ impl TransactionExecutor {
parent_block_id: HashValue,
version: Version,
commit_sender: Option<
mpsc::Sender<(HashValue, HashValue, Instant, Instant, Duration, usize)>,
mpsc::SyncSender<(HashValue, HashValue, Instant, Instant, Duration, usize)>,
>,
) -> Self {
Self {
Expand Down

0 comments on commit e6122b6

Please sign in to comment.