committed by
GitHub
parent
6c5b7ecf90
commit
5591cd6ef3
@ -12,7 +12,7 @@ use solana_runtime::{
|
||||
bank::*,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
account::{AccountSharedData, ReadableAccount},
|
||||
genesis_config::{create_genesis_config, ClusterType},
|
||||
hash::Hash,
|
||||
pubkey::Pubkey,
|
||||
@ -29,7 +29,7 @@ fn deposit_many(bank: &Bank, pubkeys: &mut Vec<Pubkey>, num: usize) {
|
||||
for t in 0..num {
|
||||
let pubkey = solana_sdk::pubkey::new_rand();
|
||||
let account =
|
||||
AccountSharedData::new((t + 1) as u64, 0, &AccountSharedData::default().owner);
|
||||
AccountSharedData::new((t + 1) as u64, 0, AccountSharedData::default().owner());
|
||||
pubkeys.push(pubkey);
|
||||
assert!(bank.get_account(&pubkey).is_none());
|
||||
bank.deposit(&pubkey, (t + 1) as u64);
|
||||
@ -153,11 +153,11 @@ fn bench_delete_dependencies(bencher: &mut Bencher) {
|
||||
false,
|
||||
);
|
||||
let mut old_pubkey = Pubkey::default();
|
||||
let zero_account = AccountSharedData::new(0, 0, &AccountSharedData::default().owner);
|
||||
let zero_account = AccountSharedData::new(0, 0, AccountSharedData::default().owner());
|
||||
for i in 0..1000 {
|
||||
let pubkey = solana_sdk::pubkey::new_rand();
|
||||
let account =
|
||||
AccountSharedData::new((i + 1) as u64, 0, &AccountSharedData::default().owner);
|
||||
AccountSharedData::new((i + 1) as u64, 0, AccountSharedData::default().owner());
|
||||
accounts.store_slow_uncached(i, &pubkey, &account);
|
||||
accounts.store_slow_uncached(i, &old_pubkey, &zero_account);
|
||||
old_pubkey = pubkey;
|
||||
@ -192,7 +192,7 @@ fn store_accounts_with_possible_contention<F: 'static>(
|
||||
(0..num_keys)
|
||||
.map(|_| {
|
||||
let pubkey = solana_sdk::pubkey::new_rand();
|
||||
let account = AccountSharedData::new(1, 0, &AccountSharedData::default().owner);
|
||||
let account = AccountSharedData::new(1, 0, AccountSharedData::default().owner());
|
||||
accounts.store_slow_uncached(slot, &pubkey, &account);
|
||||
pubkey
|
||||
})
|
||||
@ -212,7 +212,7 @@ fn store_accounts_with_possible_contention<F: 'static>(
|
||||
|
||||
let num_new_keys = 1000;
|
||||
let new_accounts: Vec<_> = (0..num_new_keys)
|
||||
.map(|_| AccountSharedData::new(1, 0, &AccountSharedData::default().owner))
|
||||
.map(|_| AccountSharedData::new(1, 0, AccountSharedData::default().owner()))
|
||||
.collect();
|
||||
bencher.iter(|| {
|
||||
for account in &new_accounts {
|
||||
@ -249,7 +249,7 @@ fn bench_concurrent_read_write(bencher: &mut Bencher) {
|
||||
fn bench_concurrent_scan_write(bencher: &mut Bencher) {
|
||||
store_accounts_with_possible_contention("concurrent_scan_write", bencher, |accounts, _| loop {
|
||||
test::black_box(
|
||||
accounts.load_by_program(&Ancestors::default(), &AccountSharedData::default().owner),
|
||||
accounts.load_by_program(&Ancestors::default(), AccountSharedData::default().owner()),
|
||||
);
|
||||
})
|
||||
}
|
||||
@ -323,7 +323,7 @@ fn setup_bench_dashmap_iter() -> (Arc<Accounts>, DashMap<Pubkey, (AccountSharedD
|
||||
dashmap.insert(
|
||||
Pubkey::new_unique(),
|
||||
(
|
||||
AccountSharedData::new(1, 0, &AccountSharedData::default().owner),
|
||||
AccountSharedData::new(1, 0, AccountSharedData::default().owner()),
|
||||
Hash::new_unique(),
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user