-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat: passes copy_cycles by const reference to avoid copying #8051
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ template <typename Flavor, bool generalized> | |
PermutationMapping<Flavor::NUM_WIRES, generalized> compute_permutation_mapping( | ||
const typename Flavor::CircuitBuilder& circuit_constructor, | ||
typename Flavor::ProvingKey* proving_key, | ||
std::vector<CyclicPermutation> wire_copy_cycles) | ||
const std::vector<CyclicPermutation>& wire_copy_cycles) | ||
{ | ||
|
||
// Initialize the table of permutations so that every element points to itself | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
[Re: line +118]
Here you are making another copy. If you do
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch, wonder if this was maybe a reason I was seeing slower timing |
||
|
@@ -368,7 +368,7 @@ inline std::tuple<LegacyPolynomial<FF>, LegacyPolynomial<FF>> compute_first_and_ | |
template <typename Flavor> | ||
void compute_permutation_argument_polynomials(const typename Flavor::CircuitBuilder& circuit, | ||
typename Flavor::ProvingKey* key, | ||
std::vector<CyclicPermutation> copy_cycles) | ||
const std::vector<CyclicPermutation>& copy_cycles) | ||
{ | ||
constexpr bool generalized = IsUltraPlonkFlavor<Flavor> || IsUltraFlavor<Flavor>; | ||
auto mapping = compute_permutation_mapping<Flavor, generalized>(circuit, key, copy_cycles); | ||
|
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 should probably be a const auto& now (the compiler will infer it though)
See this comment inline on Graphite.