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

perf: improve fft domain memory footprint #437

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Aug 16, 2023

This PR removes precompute of CosetTableReversed and CosetTableInvReversed in fft.Domain.
In practice these can be accessed from CosetTable and CosetTableInv .

New version may result in slightly slower FFT on small domains.

However, for large domains (think large plonk circuit), precomputing these and storing them in RAM contribute to a high memory load, hence the PR.

Copy link
Collaborator

@yelhousni yelhousni left a comment

Choose a reason for hiding this comment

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

This makes sense for large zkEVM circuits indeed. What is the exact slowdown on small circuits, say a 2-chain Groth16 verifier?

@gbotrel
Copy link
Collaborator Author

gbotrel commented Aug 16, 2023

Benchmarked groth16_bls12377 , virtually no delta on the M1 👍

@gbotrel
Copy link
Collaborator Author

gbotrel commented Aug 16, 2023

1% slower for a larger circuit.

@gbotrel gbotrel merged commit 1473fcf into develop Aug 16, 2023
6 checks passed
@yelhousni yelhousni deleted the perf/smallerdomain branch August 16, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants