Skip to content

Comments

perf(crypto): CRP-2550 Use Rayon in NIDKG#9007

Draft
randombit wants to merge 9 commits intomasterfrom
jack/crp-2550
Draft

perf(crypto): CRP-2550 Use Rayon in NIDKG#9007
randombit wants to merge 9 commits intomasterfrom
jack/crp-2550

Conversation

@randombit
Copy link
Contributor

This substantially improves NIDKG performance. The following table of results is from the crypto benchmarks (so no network/consensus) on my devenv which has 16 cores similar to that used in the Gen2 machines.

All times for the 40 nodes, 40 dealers, high threshold setting. The improvements for other settings are similar

Operation master rayon
create_initial_dealing 283 ms 108 ms
create_reshare_dealing 272 ms 105 ms
verify_dealing 310 ms 86 ms
create_transcript 152 ms 14 ms
load_transcript 1800 ms 166 ms
retain_active_keys/0 3640 ms 479 ms
retain_active_keys/1 3770 ms 496 ms
retain_active_keys/5 3870 ms 515 ms
retain_active_keys/15 4400 ms 589 ms
retain_active_keys/30 5200 ms 671 ms

@github-actions github-actions bot added the perf label Feb 23, 2026
@randombit
Copy link
Contributor Author

randombit commented Feb 23, 2026

Todo

  • There is a stability test for key update but I think just one. I'd like to add several more to cover different scenarios, since the update process depends on the epochs in use.
  • Verify proofs in parallel
  • Investigate BSGS
  • Table lookup for honest dealer
  • Update CON-1444 doc

@randombit
Copy link
Contributor Author

To set some number of CPUs

    let result = ThreadPoolBuilder::new()
        .num_threads(4)
        .build_global();

I'm not sure what to do here, default is # of cores but this may oversubscribe us a bit. OTOH there are points where the replica is pretty well just blocked on us and the faster the vault completes the work the better.

@randombit
Copy link
Contributor Author

randombit commented Feb 23, 2026

I checked 40 dealer 13 recipient NIDKG also since that's relevant for engines, numbers look quite good to me

crypto_nidkg_13_nodes_40_dealers_high/create_initial_dealing
                        time:   [59.307 ms 63.587 ms 69.395 ms]
crypto_nidkg_13_nodes_40_dealers_high/create_reshare_dealing
                        time:   [58.164 ms 63.475 ms 69.890 ms]
crypto_nidkg_13_nodes_40_dealers_high/verify_dealing
                        time:   [50.716 ms 50.977 ms 51.259 ms]
crypto_nidkg_13_nodes_40_dealers_high/create_transcript
                        time:   [7.0596 ms 7.1216 ms 7.1903 ms]
crypto_nidkg_13_nodes_40_dealers_high/load_transcript
                        time:   [117.18 ms 118.20 ms 119.22 ms]
crypto_nidkg_13_nodes_40_dealers_high/retain_active_keys/0
                        time:   [338.97 ms 342.47 ms 345.78 ms]
crypto_nidkg_13_nodes_40_dealers_high/retain_active_keys/1
                        time:   [355.97 ms 358.14 ms 360.47 ms]
crypto_nidkg_13_nodes_40_dealers_high/retain_active_keys/5
                        time:   [370.10 ms 373.88 ms 377.47 ms]
crypto_nidkg_13_nodes_40_dealers_high/retain_active_keys/15
                        time:   [429.25 ms 431.44 ms 433.05 ms]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant