forked from barryWhiteHat/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 57
forked from barryWhiteHat/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Avoid copy constructors to improve performance #99
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a number of places where copy constructors are used that could significantly impact performance as the size of the circuit increases. Using constant references instead of passing by value in some specific places will help a lot.
For example, in
libsnark::protoboard
the following methods return values rather than references:r1cs_variable_assignment<FieldT> full_variable_assignment() const;
r1cs_primary_input<FieldT> primary_input() const;
r1cs_auxiliary_input<FieldT> auxiliary_input() const;
r1cs_constraint_system<FieldT> get_constraint_system() const;
Making these return constant references will avoid copying a lot of data.
Making several class variables
public
will also solve this problem.The text was updated successfully, but these errors were encountered: