Skip to content
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

chore: remove temporary allocations from num_bits #6600

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TomAFrench
Copy link
Member

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:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update FieldElement.num_bits() to return 1 for a zero field element.
1 participant