perf: bench merkle stage (#1497)

This commit is contained in:
joshieDo
2023-03-01 14:20:00 +08:00
committed by GitHub
parent 4839adeaef
commit 2884eae075
14 changed files with 766 additions and 280 deletions

View File

@ -1,3 +1,4 @@
#[allow(unused_imports)]
use reth_db::{
database::Database,
mdbx::{test_utils::create_test_db_with_path, EnvKind, WriteMap},
@ -7,12 +8,15 @@ use reth_db::{
use std::path::Path;
/// Path where the DB is initialized for benchmarks.
#[allow(unused)]
const BENCH_DB_PATH: &str = "/tmp/reth-benches";
/// Used for RandomRead and RandomWrite benchmarks.
#[allow(unused)]
const RANDOM_INDEXES: [usize; 10] = [23, 2, 42, 5, 3, 99, 54, 0, 33, 64];
/// Returns bench vectors in the format: `Vec<(Key, EncodedKey, Value, CompressedValue)>`.
#[allow(unused)]
fn load_vectors<T: reth_db::table::Table>() -> Vec<(T::Key, bytes::Bytes, T::Value, bytes::Bytes)>
where
T: Default,