Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share the threadpool for tx execution and entry verifification #216

Merged
merged 5 commits into from
Mar 27, 2024
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ mod tests {
crate::banking_trace::{BankingPacketBatch, BankingTracer},
crossbeam_channel::{unbounded, Receiver},
itertools::Itertools,
solana_entry::entry::{Entry, EntrySlice},
solana_entry::entry::{self, Entry, EntrySlice},
solana_gossip::cluster_info::Node,
solana_ledger::{
blockstore::Blockstore,
Expand Down Expand Up @@ -941,7 +941,7 @@ mod tests {
.collect();
trace!("done");
assert_eq!(entries.len(), genesis_config.ticks_per_slot as usize);
assert!(entries.verify(&start_hash));
assert!(entries.verify(&start_hash, &entry::thread_pool_for_tests()));
assert_eq!(entries[entries.len() - 1].hash, bank.last_blockhash());
banking_stage.join().unwrap();
}
Expand Down Expand Up @@ -1060,7 +1060,7 @@ mod tests {
.map(|(_bank, (entry, _tick_height))| entry)
.collect();

assert!(entries.verify(&blockhash));
assert!(entries.verify(&blockhash, &entry::thread_pool_for_tests()));
if !entries.is_empty() {
blockhash = entries.last().unwrap().hash;
for entry in entries {
Expand Down
6 changes: 5 additions & 1 deletion entry/benches/entry_sigverify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use {

#[bench]
fn bench_gpusigverify(bencher: &mut Bencher) {
let thread_pool = entry::thread_pool_for_benches();
let entries = (0..131072)
.map(|_| {
let transaction = test_tx();
Expand Down Expand Up @@ -53,6 +54,7 @@ fn bench_gpusigverify(bencher: &mut Bencher) {
let res = entry::start_verify_transactions(
entries.clone(),
false,
&thread_pool,
recycler.clone(),
Arc::new(verify_transaction),
);
Expand All @@ -65,6 +67,7 @@ fn bench_gpusigverify(bencher: &mut Bencher) {

#[bench]
fn bench_cpusigverify(bencher: &mut Bencher) {
let thread_pool = entry::thread_pool_for_benches();
let entries = (0..131072)
.map(|_| {
let transaction = test_tx();
Expand All @@ -89,6 +92,7 @@ fn bench_cpusigverify(bencher: &mut Bencher) {
};

bencher.iter(|| {
let _ans = entry::verify_transactions(entries.clone(), Arc::new(verify_transaction));
let _ans =
entry::verify_transactions(entries.clone(), &thread_pool, Arc::new(verify_transaction));
})
}
Loading
Loading