-
Notifications
You must be signed in to change notification settings - Fork 0
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
Vectorize msgs #17
Vectorize msgs #17
Conversation
let (commitment, buffer): (Commitment, [u8; 32]) = recv_from(channel, p, "RNG") | ||
.await? | ||
.pop() | ||
.ok_or(Error::EmptyMsg)?; |
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.
Very nice! I assume this should now be added to each recv_from (whenever it's not a vector that is being sent), do I get it right?
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 exactly, we could also add back a method like recv_single_from
, but since this behavior isn't needed very often I felt like this way of doing it was fine.
let c0 = commit(&d0[r].to_be_bytes()); | ||
let c1 = commit(&d1[r].to_be_bytes()); | ||
let cm = commit(&dm); | ||
own_commitments.push((c0, c1, cm, dm)) |
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.
Nice, and much simpler this way!
@@ -673,7 +677,7 @@ pub(crate) async fn faand_precomp( | |||
let triples = transform(xbits, ybits, &zbits, lprime); | |||
|
|||
// Step 2 assign objects to buckets. | |||
let mut buckets: Vec<Vec<(Share, Share, Share)>> = vec![vec![]; length]; | |||
let mut buckets: Vec<SmallVec<[(Share, Share, Share); 3]>> = vec![smallvec![]; length]; |
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.
Just out of curiosity and to learn: what is the specific reason here for using SmallVec for buckets? Is there some performance-related reason?
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.
Exactly. The vector is kept on the stack, bringing down the total runtime of the benchmark from 10 minutes to 7 minutes when I tested it with 250 records.
No description provided.