Skip to content

perf(evm): fold corpus mutation optimizations#15558

Draft
decofe wants to merge 2 commits into
masterfrom
centaur/fold-perf-corpus-mutations-1783053899
Draft

perf(evm): fold corpus mutation optimizations#15558
decofe wants to merge 2 commits into
masterfrom
centaur/fold-perf-corpus-mutations-1783053899

Conversation

@decofe

@decofe decofe commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Folds the small corpus mutation perf PRs into one reviewable PR:

The folded changes are limited to corpus mutation bookkeeping:

  • avoid storing all-empty cmp payload vectors
  • avoid allocating a one-element mutation index vector for single-arg ABI mutation

Validation:

  • cargo fmt --all
  • cargo test -p foundry-evm corpus --lib

Prompted by: @grandizzy

@mablr

mablr commented Jul 3, 2026

Copy link
Copy Markdown
Member

I benchmarked the corpus changes against origin/master with temporary targeted microbench tests inside corpus.rs, built with Foundry's profiling profile. The benchmarks cover both changed paths: single-argument ABI mutation and all-empty cmp-sequence handling.

Results:

Benchmark master this PR delta
single-arg abi_mutate 446.471 ns/op 411.623 ns/op ~7.8% faster
all-empty cmp-seq storage, 10k inputs 48.504 ns/input, stores 10k empty cmp entries 146.283 ns/input, stores 0 cmp entries CPU slower, payload much smaller

Recommendation: merge, but frame the cmp-sequence change as a memory/storage win rather than a CPU win. The single-argument mutation optimization is a clear targeted CPU improvement. The empty cmp-sequence path spends more CPU to detect and trim the all-empty payload, but avoids retaining/persisting thousands of empty cmp vectors, which is likely the more important behavior for corpus size and serialization overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants