feat: set up codspeed (#13372)

This commit is contained in:
DaniPopes
2024-12-20 13:21:51 +02:00
committed by GitHub
parent 3966130844
commit a4f86b0e2d
34 changed files with 318 additions and 398 deletions

View File

@ -3,7 +3,7 @@
use std::{collections::HashSet, path::Path, sync::Arc};
use criterion::{
black_box, criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
};
use pprof::criterion::{Output, PProfProfiler};
use proptest::{
@ -20,6 +20,7 @@ use reth_db_api::{
transaction::DbTxMut,
};
use reth_fs_util as fs;
use std::hint::black_box;
mod utils;
use utils::*;
@ -46,6 +47,12 @@ pub fn hash_keys(c: &mut Criterion) {
group.sample_size(10);
for size in [10_000, 100_000, 1_000_000] {
// Too slow.
#[allow(unexpected_cfgs)]
if cfg!(codspeed) && size > 10_000 {
continue;
}
measure_table_insertion::<TransactionHashNumbers>(&mut group, size);
}
}