Skip to content

Commit

Permalink
Update bench
Browse files Browse the repository at this point in the history
  • Loading branch information
steviez committed Mar 25, 2024
1 parent 1aba83a commit fe26ee3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion entry/benches/entry_sigverify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extern crate test;
use {
solana_entry::entry::{self, VerifyRecyclers},
solana_perf::test_tx::test_tx,
solana_rayon_threadlimit::get_max_thread_count,
solana_sdk::{
hash::Hash,
transaction::{
Expand All @@ -16,6 +17,12 @@ use {

#[bench]
fn bench_gpusigverify(bencher: &mut Bencher) {
let thread_pool = rayon::ThreadPoolBuilder::new()
.num_threads(get_max_thread_count())
.thread_name(|i| format!("solEntryBench{i:02}"))
.build()
.expect("new rayon threadpool");

let entries = (0..131072)
.map(|_| {
let transaction = test_tx();
Expand Down Expand Up @@ -53,6 +60,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 +73,12 @@ fn bench_gpusigverify(bencher: &mut Bencher) {

#[bench]
fn bench_cpusigverify(bencher: &mut Bencher) {
let thread_pool = rayon::ThreadPoolBuilder::new()
.num_threads(get_max_thread_count())
.thread_name(|i| format!("solEntryBench{i:02}"))
.build()
.expect("new rayon threadpool");

let entries = (0..131072)
.map(|_| {
let transaction = test_tx();
Expand All @@ -89,6 +103,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));
})
}

0 comments on commit fe26ee3

Please sign in to comment.