Skip to content

perf(cache): prepare pairing points in parallel - #30

Merged
markosg04 merged 1 commit into
mainfrom
perf/prepared-cache-parallel-v2
Aug 20, 2026
Merged

markosg04 merged 1 commit into
mainfrom
perf/prepared-cache-parallel-v2

Conversation

@0xAndoroid

Copy link
Copy Markdown
Collaborator

What changed

  • Build the G1/G2 prepared-point vectors concurrently with rayon::join; each vector uses par_iter.
  • Do all preparation outside the global cache write lock, then double-check before replacing the cache.
  • Keep the existing init_cache API and first-initializer-wins semantics.

PR #27 is already on main, but it parallelizes DoryRoutines vector operations in ark_group.rs; cache preparation in ark_cache.rs remains serial. This replaces closed PR #26 on top of v0.4.1.

Benchmarks

Apple M4, 10 cores, log_n = 34 (131,072 G1 + 131,072 G2 generators), release build, median of 3 runs:

main this PR change
init_cache 6.451 s 0.529 s −91.8%, 12.2×

Setup generation was excluded from timing.

Verification

  • cargo nextest run --cargo-quiet --features backends,cache: 85/85
  • cargo nextest run --cargo-quiet --features backends,cache,zk: 142/142
  • cargo clippy --all-targets --features backends,cache,zk -q --message-format=short -- -D warnings
  • cargo fmt -q --message-format=short -- --check

Companion to a16z/jolt#1737.

@markosg04 markosg04 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me—thanks!

@markosg04
markosg04 merged commit 6a65952 into main Aug 20, 2026
9 checks passed
@0xAndoroid
0xAndoroid deleted the perf/prepared-cache-parallel-v2 branch September 14, 2026 22:40
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.

2 participants