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.
The
GetCellmethod returns the cell via allocation of a new slice and copying desired cell into it. Presumably, this is done for encapsulation reasons. However, theGetCellis 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:GetCellUnsafemethodGetCellmethod to return the subslice stored on the EDS.