-
Notifications
You must be signed in to change notification settings - Fork 251
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
Sparse poly eval #214
Sparse poly eval #214
Conversation
691d9a1
to
7340519
Compare
7340519
to
85e9128
Compare
let total_bits = core::mem::size_of::<usize>() * 8; | ||
let max_pow_2 = total_bits - self.degree().leading_zeros() as usize; | ||
|
||
let mut pows_2 = Vec::<F>::with_capacity(max_pow_2); |
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.
This is computing log2(total_bits)
, right? You can replace it with let max_pow_2 = ark_std::log2(total_bits);
.
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.
fair enough
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.
imo this should be a usize default function
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.
btw, I am uncomfortable with the current name, imo it ought to be named log2_then_ceil
, or log2_of_next_pow_of_2
or something. I like the second name best.
Thanks for this! This LGTM once the comment is addressed |
Ok, it should be good to merge now |
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
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.
Thanks, this looks good now!
Description
closes: #123
Results:
2.5x improvement.
New
Old
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer