celestiaorg / celestiaorg/rsmt2d

perf: Consider removing deepcopy

Open
#311 1 comment 3 reactions 1 assignee Assigned to @Copilot View on GitHub
Dominant language
Go
Stars
169
Forks
87
Avg merge
8h 9m
Merged PRs (30d)
7

Description

The use of `deepcopy()` in our codebase significantly reduces performance because of the large number of allocations it requires. There is no need for `deepcopy()` if the caller only wishes to read the data and not modify it. This creates a performance burden for readers to protect the interests of those who may want to modify the data. It would be more efficient to perform `deepcopy()` on the caller's side when necessary, rather than doing it implicitly all the time. We might want to consider documenting exported methods to indicate that a `deepcopy()` is needed if the data is to be modified. And remove preemptive `deepcopy()` from exported methods.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.