mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: set up codspeed (#13372)
This commit is contained in:
@ -120,6 +120,8 @@ test-utils = [
|
||||
"reth-static-file",
|
||||
"reth-tracing",
|
||||
"reth-trie/test-utils",
|
||||
"reth-trie-db/test-utils",
|
||||
"reth-trie-sparse/test-utils",
|
||||
"reth-prune-types?/test-utils",
|
||||
"reth-trie-db/test-utils",
|
||||
"reth-trie-parallel/test-utils",
|
||||
]
|
||||
|
||||
@ -7,7 +7,7 @@ use revm_primitives::{
|
||||
Account, AccountInfo, AccountStatus, Address, EvmState, EvmStorage, EvmStorageSlot, HashMap,
|
||||
B256, U256,
|
||||
};
|
||||
use std::thread;
|
||||
use std::{hint::black_box, thread};
|
||||
|
||||
/// Creates a mock state with the specified number of accounts for benchmarking
|
||||
fn create_bench_state(num_accounts: usize) -> EvmState {
|
||||
@ -47,7 +47,7 @@ impl StdStateRootTask {
|
||||
|
||||
fn run(self) {
|
||||
while let Ok(state) = self.rx.recv() {
|
||||
criterion::black_box(state);
|
||||
black_box(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ impl CrossbeamStateRootTask {
|
||||
|
||||
fn run(self) {
|
||||
while let Ok(state) = self.rx.recv() {
|
||||
criterion::black_box(state);
|
||||
black_box(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
|
||||
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
|
||||
use reth_engine_tree::tree::root::{StateRootConfig, StateRootTask};
|
||||
use reth_evm::system_calls::OnStateHook;
|
||||
use reth_primitives::{Account as RethAccount, StorageEntry};
|
||||
@ -22,6 +22,7 @@ use revm_primitives::{
|
||||
Account as RevmAccount, AccountInfo, AccountStatus, Address, EvmState, EvmStorageSlot, HashMap,
|
||||
B256, KECCAK_EMPTY, U256,
|
||||
};
|
||||
use std::hint::black_box;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct BenchParams {
|
||||
|
||||
Reference in New Issue
Block a user