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

Banking stage offload cost model to sep thread #18275

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/benches/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use solana_sdk::timing::{duration_as_us, timestamp};
use solana_sdk::transaction::Transaction;
use std::collections::VecDeque;
use std::sync::atomic::Ordering;
use std::sync::mpsc::Receiver;
use std::sync::mpsc::{channel, Receiver};
use std::sync::{Arc, RwLock};
use std::time::{Duration, Instant};
use test::Bencher;
Expand Down Expand Up @@ -80,6 +80,7 @@ fn bench_consume_buffered(bencher: &mut Bencher) {
packets.push_back((batch, vec![0usize; batch_len], false));
}
let (s, _r) = unbounded();
let (cost_update_sender, _cost_update_receiver) = channel();
// This tests the performance of buffering packets.
// If the packet buffers are copied, performance will be poor.
bencher.iter(move || {
Expand All @@ -95,6 +96,7 @@ fn bench_consume_buffered(bencher: &mut Bencher) {
&recorder,
&Arc::new(RwLock::new(CostModel::default())),
&Arc::new(RwLock::new(CostTracker::new(std::u64::MAX, std::u64::MAX))),
cost_update_sender.clone(),
);
});

Expand Down
Loading