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

perf: Consider removing deepcopy #311

Open
walldiss opened this issue Apr 9, 2024 · 1 comment
Open

perf: Consider removing deepcopy #311

walldiss opened this issue Apr 9, 2024 · 1 comment

Comments

@walldiss
Copy link
Member

walldiss commented Apr 9, 2024

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.

@Wondertan
Copy link
Member

Related to #232

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

No branches or pull requests

2 participants