Skip to content

chore: add criterion benchmark for evm build#2319

Merged
rakita merged 2 commits intobluealloy:mainfrom
shane-moore:chore/benchmark-evm-build
Mar 27, 2025
Merged

chore: add criterion benchmark for evm build#2319
rakita merged 2 commits intobluealloy:mainfrom
shane-moore:chore/benchmark-evm-build

Conversation

@shane-moore
Copy link
Contributor

@shane-moore shane-moore commented Mar 26, 2025

Changes

Note:

  • the build_mainnet step was left out of the benchmark as to focus on time spent to initialize instructions. Let me know if the intention was to include the build_mainnet into the benchmark as well, and I'll happily add it 🤙

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 26, 2025

CodSpeed Performance Report

Merging #2319 will not alter performance

Comparing shane-moore:chore/benchmark-evm-build (e537c96) with main (89f273a)

Summary

✅ 8 untouched benchmarks
🆕 1 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 evm-build N/A 8.3 µs N/A

@shane-moore
Copy link
Contributor Author

hi @rakita, this PR is ready for review whenever you get a chance


criterion.bench_function("evm_build", |b| {
b.iter(|| {
let _ = evm.replay().unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _ = evm.replay().unwrap();
let _ = Context::mainnet().build_mainnet();

Buildering of EVM should be here, not a replay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha! updated to

pub fn run(criterion: &mut Criterion) {
criterion.bench_function("evm-build", |b| {
b.iter(|| {
let _ = Context::mainnet().build_mainnet();
});
});

BenchName::Burntpix => "burntpix",
BenchName::Snailtracer => "snailtracer",
BenchName::Transfer => "transfer",
BenchName::EvmBuild => "evm_build",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BenchName::EvmBuild => "evm_build",
BenchName::EvmBuild => "evm-build",

For outside names using dash is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point @rakita, updated to:

BenchName::EvmBuild => "evm-build",

agreed that cargo bench --package revme -- evm-build does look cleaner

@rakita rakita merged commit d79ff44 into bluealloy:main Mar 27, 2025
29 checks passed
This was referenced Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add benchmark for Evm build

2 participants