Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Use measure! for bank.prepare_sanitized_batch_with_results
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Nov 16, 2022
1 parent e803ce8 commit cc3a485
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,9 +1507,9 @@ impl BankingStage {
// Only lock accounts for those transactions are selected for the block;
// Once accounts are locked, other threads cannot encode transactions that will modify the
// same account state
let mut lock_time = Measure::start("lock_time");
let batch = bank.prepare_sanitized_batch_with_results(txs, transactions_qos_results.iter());
lock_time.stop();
let (batch, lock_time) = measure!(
bank.prepare_sanitized_batch_with_results(txs, transactions_qos_results.iter())
);

// retryable_txs includes AccountInUse, WouldExceedMaxBlockCostLimit
// WouldExceedMaxAccountCostLimit, WouldExceedMaxVoteCostLimit
Expand All @@ -1524,10 +1524,8 @@ impl BankingStage {
log_messages_bytes_limit,
);

let mut unlock_time = Measure::start("unlock_time");
// Once the accounts are new transactions can enter the pipeline to process them
drop(batch);
unlock_time.stop();
let (_, unlock_time) = measure!(drop(batch));

let ExecuteAndCommitTransactionsOutput {
ref mut retryable_transaction_indexes,
Expand Down

0 comments on commit cc3a485

Please sign in to comment.