noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
902 stars 203 forks source link

chore: remove temporary allocations from `num_bits` #6600

Open TomAFrench opened 9 hours ago

TomAFrench commented 9 hours ago

Description

Problem*

Closes #4759

Summary*

I found this due to #6550.

We make heavy use of the num_bits method during compilation but this is currently doing a lot of unnecessary allocations in order to perform a full bit decomposition of the field element. We can rework this to work on the byte decomposition which removes 96% of all the temporary allocations from compilation.

Additional Context

Documentation*

Check one:

PR Checklist*