Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groth16 prover: improve param loading #217

Merged
merged 2 commits into from
Sep 27, 2021
Merged

Conversation

dignifiedquire
Copy link

Simplified version of #214

Comment on lines 340 to 351
THREAD_POOL.scoped(|s| {
let a_s = &mut a_s;
s.execute(move || {
let mut fft_kern = Some(LockedFFTKernel::<E>::new(log_d, priority));

drop(fft_kern);
let mut multiexp_kern = Some(LockedMultiexpKernel::<E>::new(log_d, priority));
for prover in provers_ref {
a_s.push(execute_fft(worker, prover, &mut fft_kern));
}
});

debug!("get h");
params_h = Some(params.get_h(n));
Copy link

Choose a reason for hiding this comment

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

In this case you do the kernel creation and the parameter loading in parallel. You spawn the kernel creation into a new thread, but you wait until both are finished. In the code below, you spawn the parameter generation and do something else on the main thread. Would it make sense (for consistency, and easier to follow code) to change this part to also spawn the parameter generation and leave the kernel generation on the main thread?

Copy link
Author

Choose a reason for hiding this comment

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

yes, fixed

cryptonemo
cryptonemo previously approved these changes Sep 27, 2021
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.

3 participants