move Account to solana-sdk (#13198)
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
use solana_sdk::{slot_history::SlotHistory, sysvar::Sysvar};
|
||||
use solana_sdk::{
|
||||
account::{create_account, from_account},
|
||||
slot_history::SlotHistory,
|
||||
};
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
@ -9,8 +12,8 @@ fn bench_to_from_account(b: &mut Bencher) {
|
||||
let mut slot_history = SlotHistory::default();
|
||||
|
||||
b.iter(|| {
|
||||
let account = slot_history.create_account(0);
|
||||
slot_history = SlotHistory::from_account(&account).unwrap();
|
||||
let account = create_account(&slot_history, 0);
|
||||
slot_history = from_account::<SlotHistory>(&account).unwrap();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user