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

@ -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);
}
}
}

View File

@ -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 {