Skip to content

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

Draft
diegokingston wants to merge 1 commit into
mainfrom
perf/guest-zerocopy
Draft

perf(guest): read the private input zero-copy via ef_io::read_input#886
diegokingston wants to merge 1 commit 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

Copy link
Copy Markdown

Benchmark — ethrex 20 transfers (median of 3)

Table parallelism: auto (cores / 3)

Metric main PR Δ
Peak heap 50217 MB 50237 MB +20 MB (+0.0%) ⚪
Prove time 24.695s 24.813s +0.118s (+0.5%) ⚪

✅ No significant change.

✅ Low variance (time: 1.1%, heap: 0.9%)

Commit: 75f4083 · Baseline: cached · Runner: self-hosted 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