* Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing
* Add comment to store_account_and_update_capitalization
* Simplify account.rent_epoch handling for sysvar rent
* Introduce *_for_test functions
* Add deprecation messages to existing api
(cherry picked from commit 6d5c6c17c5)
# Conflicts:
#	sdk/src/native_loader.rs
* Fix conflicts
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			548 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			548 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
#![feature(test)]
 | 
						|
 | 
						|
extern crate test;
 | 
						|
use solana_sdk::{
 | 
						|
    account::{create_account_for_test, from_account},
 | 
						|
    hash::Hash,
 | 
						|
    slot_hashes::{Slot, SlotHashes, MAX_ENTRIES},
 | 
						|
};
 | 
						|
use test::Bencher;
 | 
						|
 | 
						|
#[bench]
 | 
						|
fn bench_to_from_account(b: &mut Bencher) {
 | 
						|
    let mut slot_hashes = SlotHashes::new(&[]);
 | 
						|
    for i in 0..MAX_ENTRIES {
 | 
						|
        slot_hashes.add(i as Slot, Hash::default());
 | 
						|
    }
 | 
						|
    b.iter(|| {
 | 
						|
        let account = create_account_for_test(&slot_hashes);
 | 
						|
        slot_hashes = from_account::<SlotHashes, _>(&account).unwrap();
 | 
						|
    });
 | 
						|
}
 |