-
Notifications
You must be signed in to change notification settings - Fork 120
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
Conversation
8b176ce
to
231802a
Compare
efc916a
to
d80ccc1
Compare
src/groth16/prover.rs
Outdated
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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fixed
d80ccc1
to
27fa9a4
Compare
27fa9a4
to
f8efb85
Compare
Simplified version of #214