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

over-use of cloning on things that could be dereferenced or simply passed by reference #79

Closed
robfitzgerald opened this issue Dec 14, 2023 · 0 comments · Fixed by #85
Closed
Assignees

Comments

@robfitzgerald
Copy link
Collaborator

noting that

  • there are quite a few places where something like a newtype is being cloned just because the function signature expects a type passed by value, not by reference (see the units libraries like Distance and DistanceUnit, etc)
  • some things are being passed by value that could be passed by reference, and those calls end up cloning those values (can't think of where i've seen this but i know there's a good deal of it)

this unnecessary cloning adds a time and space complexity hit when we are talking about low-level operations such as unit conversion, serialization, or anything in the loop of search, so we should go spelunking to remove them.

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 a pull request may close this issue.

1 participant