There seems to be excessive use of clone() features throughout the repo and even in loops.
Loops example :
zk_prover/src/merkle_sum_tree/utils/build_tree.rs
for (index, leaf) in leaves.iter().enumerate() {
tree[0][index] = leaf.clone();
}
Are these excessive use of cloning throughout repo the real use cases of needing a copy or a simple work around the borrow-checker? If this is simply to avoid compiler error, this is an anti-pattern by cloning the variable and an alternative should be worked upon. Excessive cloning can have performance impacts. If these all cloning usages are required per use case, then cloning optimisation techniques can be applied.
There seems to be excessive use of clone() features throughout the repo and even in loops.
Loops example : zk_prover/src/merkle_sum_tree/utils/build_tree.rs for (index, leaf) in leaves.iter().enumerate() { tree[0][index] = leaf.clone(); }
Are these excessive use of cloning throughout repo the real use cases of needing a copy or a simple work around the borrow-checker? If this is simply to avoid compiler error, this is an anti-pattern by cloning the variable and an alternative should be worked upon. Excessive cloning can have performance impacts. If these all cloning usages are required per use case, then cloning optimisation techniques can be applied.