plonk icon indicating copy to clipboard operation
plonk copied to clipboard

Try to use Iterator instead of `for` when possible across the repo

Open CPerezz opened this issue 4 years ago • 0 comments

We have an excessive usage of for _ in .. which doesn't take profit of the Iterator benefits such as the autovectorization.

Specially, there were included several for loops in #292 & #255

This are some of the places where we could optimize the loops: https://github.com/dusk-network/plonk/blob/a8796248ed21fe7a32c25e04b5123df91cb7618d/src/constraint_system/ecc/scalar_mul/fixed_base/mod.rs#L52 https://github.com/dusk-network/plonk/blob/a8796248ed21fe7a32c25e04b5123df91cb7618d/src/constraint_system/ecc/scalar_mul/fixed_base/mod.rs#L72 https://github.com/dusk-network/plonk/blob/a8796248ed21fe7a32c25e04b5123df91cb7618d/src/constraint_system/ecc/scalar_mul/variable_base/mod.rs#L18 https://github.com/dusk-network/plonk/blob/a8796248ed21fe7a32c25e04b5123df91cb7618d/src/constraint_system/ecc/scalar_mul/variable_base/mod.rs#L103 https://github.com/dusk-network/plonk/blob/a8796248ed21fe7a32c25e04b5123df91cb7618d/src/constraint_system/ecc/scalar_mul/variable_base/mod.rs#L125

CPerezz avatar Aug 26 '20 07:08 CPerezz