Skip to content

feat: add burntpix benchmark and unify execution paths#316

Open
DaniPopes wants to merge 9 commits intomainfrom
dani/unified-bench
Open

feat: add burntpix benchmark and unify execution paths#316
DaniPopes wants to merge 9 commits intomainfrom
dani/unified-bench

Conversation

@DaniPopes
Copy link
Copy Markdown
Contributor

Add the BurntPix on-chain generative art contracts as a fixture-based benchmark (Cancun spec).

Unify the CLI and criterion benchmark execution so both bytecode-only and fixture benchmarks go through the same transact() flow. Bytecode benchmarks are wrapped into a synthetic fixture with a BENCH_CONTRACT and BENCH_CALLER. Benchmarks using stack_input are detected via is_runnable() and skipped for transaction-based execution.

Depends on #315.

Add EvmCompiler::new_llvm(aot) convenience constructor that combines
EvmLlvmBackend::new and EvmCompiler::new. Replace all call sites that
were using the two-step pattern with the concrete LLVM backend.
Add the BurntPix on-chain generative art contracts as a fixture-based
benchmark (Cancun spec).

Unify the CLI and criterion benchmark execution so both bytecode-only
and fixture benchmarks go through the same transact() flow. Bytecode
benchmarks are wrapped into a synthetic fixture with a BENCH_CONTRACT
and BENCH_CALLER. Benchmarks using stack_input are detected via
is_runnable() and skipped for transaction-based execution.
Address::ZERO causes ERC20 contracts to revert on mint-to-zero checks
when running through transact(). Use 0x1111...1111 instead and update
the WETH balanceOf storage slot hash accordingly.
Call jit_function after translate_inner in JIT mode so the module gets
finalized and opt.ll/opt.s dumps are written. Without this the codegen
FileCheck tests failed because opt.ll was never produced.

Change sanity_check to compare interpreter vs JIT result parity instead
of asserting both succeed. Benchmarks like fiat_token called with no
calldata legitimately revert.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 20, 2026

Merging this PR will degrade performance by 99.98%

⚡ 2 improved benchmarks
❌ 15 regressed benchmarks
✅ 51 untouched benchmarks
🆕 18 new benchmarks
⏩ 1 skipped benchmark1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 airdrop/rt/jit N/A 39.6 µs N/A
airdrop/rt/interpreter 6.6 µs 40.7 µs -83.83%
🆕 fiat_token/rt/jit N/A 35.2 µs N/A
factorial/rt/interpreter 266.1 µs 298 µs -10.7%
bswap64/rt/interpreter 10.3 µs 42.5 µs -75.86%
🆕 factorial/rt/jit N/A 53.8 µs N/A
eip4788/rt/interpreter 6.1 µs 38.9 µs -84.29%
🆕 bswap64/rt/jit N/A 39.3 µs N/A
🆕 burntpix/rt/jit N/A 87.1 ms N/A
🆕 eip4788/rt/jit N/A 38.5 µs N/A
🆕 burntpix/rt/interpreter N/A 280.3 ms N/A
fiat_token/rt/interpreter 2.9 µs 35.6 µs -91.92%
🆕 bswap64_opt/rt/jit N/A 38 µs N/A
erc20_transfer/rt/interpreter 10.2 µs 45,747.5 µs -99.98%
🆕 counter/rt/jit N/A 38.2 µs N/A
bswap64_opt/rt/interpreter 9.8 µs 42 µs -76.66%
counter/rt/interpreter 6.3 µs 39.7 µs -84.03%
🆕 erc20_transfer/rt/jit N/A 39 ms N/A
🆕 eip2935/rt/jit N/A 38 µs N/A
eip2935/rt/interpreter 5.8 µs 38.9 µs -84.95%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing dani/unified-bench (91ff075) with main (24772e2)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

Use iter_batched so DB + EVM construction happens in the setup closure
and only transact/handler.run is measured. Introduce EvmWithDb to
safely co-locate the CacheDB and the EVM that borrows it.
Add load_with that takes an external compiler, and clear_ir() between
benchmarks to free IR while keeping JIT'd machine code alive. This
avoids rebuilding the LLVM compiler per benchmark, which is especially
costly under valgrind (codspeed).
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.

1 participant