Skip to content

perf(guest): read the private input zero-copy via ef_io::read_input - #886

Draft
diegokingston wants to merge 2 commits into
mainfrom
perf/guest-zerocopy
Draft

perf(guest): read the private input zero-copy via ef_io::read_input#886
diegokingston wants to merge 2 commits into
mainfrom
perf/guest-zerocopy

Conversation

@diegokingston

Copy link
Copy Markdown
Collaborator

get_private_input() to_vec()'s the whole memory-mapped input before rkyv deserializes it; read_input hands rkyv a slice straight into the input region instead. Same bytes, same private-input commitment.

Measured vs origin/main (same fixtures, deterministic):
transfers_20 8,732,213 -> 8,692,490 (-39,723)
erc20_20 10,328,222 -> 10,278,822 (-49,400)
mixed_20 9,817,444 -> 9,768,492 (-48,952)

Verified: test_prove_ethrex_empty_block (prove+verify) passes.

get_private_input() to_vec()'s the whole memory-mapped input before rkyv
deserializes it; read_input hands rkyv a slice straight into the input
region instead. Same bytes, same private-input commitment.

Measured vs origin/main (same fixtures, deterministic):
  transfers_20  8,732,213 -> 8,692,490  (-39,723)
  erc20_20     10,328,222 -> 10,278,822 (-49,400)
  mixed_20      9,817,444 -> 9,768,492  (-48,952)

Verified: test_prove_ethrex_empty_block (prove+verify) passes.
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Benchmark — real block (ethrex_mainnet_25368371.bin) (median of 3)

continuations · epoch 2^22 · 12 epochs

Metric main PR Δ
Peak heap 51856 MB 51167 MB -689 MB (-1.3%) ⚪
Prove time 159.217s 147.340s -11.877s (-7.5%) 🟢

-7.5% — beyond what 3 runs resolve. Use /bench-abba for a paired test.

Prove-time spread 1.5% (146.813s / 148.999s / 147.340s)

Commit: 383ccb8 · Baseline: cached · Runner: self-hosted bench

@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench

@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench

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