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:
[x] No documentation needed.
[ ] Documentation included in this PR.
[ ] [For Experimental Features] Documentation to be submitted in a separate PR.
PR Checklist*
[x] I have tested the changes locally.
[x] I have formatted the changes with Prettier and/or cargo fmt on default settings.
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*
cargo fmt
on default settings.