Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
remove benchmarks used just for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Jun 23, 2022
1 parent 0b3cef4 commit 033fe6b
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions runtime/benches/status_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ extern crate test;

use {
bincode::serialize,
itertools::Itertools,
solana_runtime::{bank::BankStatusCache, status_cache::*},
solana_sdk::{
hash::{hash, Hash},
Expand Down Expand Up @@ -64,43 +63,3 @@ fn bench_status_cache_root_slot_deltas(bencher: &mut Bencher) {

bencher.iter(|| test::black_box(status_cache.root_slot_deltas()));
}

// bprumo TODO: remove this bench
#[bench]
fn bench_status_cache_slot_deltas_get_roots_sorted(bencher: &mut Bencher) {
let mut status_cache = BankStatusCache::default();

// fill the status cache
let slots: Vec<_> = (42..).take(MAX_CACHE_ENTRIES).collect();
for slot in &slots {
for _ in 0..5 {
status_cache.insert(&Hash::new_unique(), Hash::new_unique(), *slot, Ok(()));
}
status_cache.add_root(*slot);
}

bencher.iter(|| {
let slots: Vec<_> = status_cache.roots().iter().cloned().sorted().collect();
test::black_box(status_cache.slot_deltas(&slots))
});
}

// bprumo TODO: remove this bench
#[bench]
fn bench_status_cache_slot_deltas_get_roots_unsorted(bencher: &mut Bencher) {
let mut status_cache = BankStatusCache::default();

// fill the status cache
let slots: Vec<_> = (42..).take(MAX_CACHE_ENTRIES).collect();
for slot in &slots {
for _ in 0..5 {
status_cache.insert(&Hash::new_unique(), Hash::new_unique(), *slot, Ok(()));
}
status_cache.add_root(*slot);
}

bencher.iter(|| {
let slots: Vec<_> = status_cache.roots().iter().cloned().collect();
test::black_box(status_cache.slot_deltas(&slots))
});
}

0 comments on commit 033fe6b

Please sign in to comment.