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

api: revisit GetCell allocations #232

Open
Wondertan opened this issue Jul 6, 2023 · 0 comments
Open

api: revisit GetCell allocations #232

Wondertan opened this issue Jul 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Wondertan
Copy link
Member

The GetCell method returns the cell via allocation of a new slice and copying desired cell into it. Presumably, this is done for encapsulation reasons. However, the GetCell is used in hot paths putting pressure on GC(TODO profiles showing that). So we have a trade-off between foolproof API(prohibiting users from altering the internal slice in rsmt2d) and performance. The proposal is to either:

  • Add the new GetCellUnsafe method
    • Still breaks the perfect encapsulation leaking the internal slice for overwrites
  • Change the GetCell method to return the subslice stored on the EDS.
@rootulp rootulp added the enhancement New feature or request label Jul 6, 2023
@Wondertan Wondertan changed the title api: revisit GetCell allocatation api: revisit GetCell allocations Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants