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

Allow multiple instructions per transaction #602

Closed
wants to merge 6 commits into from
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
7 changes: 4 additions & 3 deletions benches/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ use solana::signature::{KeyPair, KeyPairUtil};
use solana::transaction::Transaction;

fn bench_process_transaction(bencher: &mut Bencher) {
let mint = Mint::new(100_000_000);
let bank = Bank::new(&mint);
let mut mint = Mint::new(100_000_000);
let bank = Bank::new(&mut mint);
let last_id = mint.last_id();

// Create transactions between unrelated parties.
let transactions: Vec<_> = (0..4096)
.into_par_iter()
.map(|i| {
// Seed the 'from' account.
let rando0 = KeyPair::new();
let tx = Transaction::new(&mint.keypair(), rando0.pubkey(), 10_000, mint.last_id());
let tx = Transaction::new(&mint.keypair(), rando0.pubkey(), 10_000, last_id);
assert!(bank.process_transaction(&tx).is_ok());

// Seed the 'to' account and a cell for its signature.
Expand Down
18 changes: 6 additions & 12 deletions benches/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn check_txs(batches: usize, receiver: &Receiver<Signal>, ref_tx_count: usize) {
fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
let tx = 10_000_usize;
let mint_total = 1_000_000_000_000;
let mint = Mint::new(mint_total);
let mut mint = Mint::new(mint_total);
let num_dst_accounts = 8 * 1024;
let num_src_accounts = 8 * 1024;

Expand Down Expand Up @@ -131,7 +131,7 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {
.collect();

bencher.iter(move || {
let bank = Arc::new(Bank::new(&mint));
let bank = Arc::new(Bank::new(&mut mint));

let verified_setup: Vec<_> =
to_packets_chunked(&packet_recycler, &setup_transactions.clone(), tx)
Expand Down Expand Up @@ -168,7 +168,8 @@ fn bench_banking_stage_multi_accounts(bencher: &mut Bencher) {

fn bench_banking_stage_single_from(bencher: &mut Bencher) {
let tx = 10_000_usize;
let mint = Mint::new(1_000_000_000_000);
let mut mint = Mint::new(1_000_000_000_000);
let last_id = mint.last_id();
let mut pubkeys = Vec::new();
let num_keys = 8;
for _ in 0..num_keys {
Expand All @@ -177,22 +178,15 @@ fn bench_banking_stage_single_from(bencher: &mut Bencher) {

let transactions: Vec<_> = (0..tx)
.into_par_iter()
.map(|i| {
Transaction::new(
&mint.keypair(),
pubkeys[i % num_keys],
i as i64,
mint.last_id(),
)
})
.map(|i| Transaction::new(&mint.keypair(), pubkeys[i % num_keys], i as i64, last_id))
.collect();

let (verified_sender, verified_receiver) = channel();
let (signal_sender, signal_receiver) = channel();
let packet_recycler = PacketRecycler::default();

bencher.iter(move || {
let bank = Arc::new(Bank::new(&mint));
let bank = Arc::new(Bank::new(&mut mint));
let verified: Vec<_> = to_packets_chunked(&packet_recycler, &transactions.clone(), tx)
.into_iter()
.map(|x| {
Expand Down
Loading