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

Remove all clones and copies from serializations #234

Merged
merged 3 commits into from
Feb 21, 2020

Conversation

austinabell
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:
Sorry I was trying to wait to do this but it was starting to bug me. When serializing you don't need to clone or copy the data because all you need is a reference to that data. I want to change this so we stop using the cloning strategy as a standard.

This may seem like a small change, but this will definitely add up quickly with all of the data we will be serializing by removing unnecessary heap allocations and copies.

Unfortunately it requires an asymmetrical type for tuple types that are defined to be annotated, but changes nothing externally and is only slightly more verbose.

Reference issue to close (if applicable)

Closes

Other information and links

Copy link
Member

@ansermino ansermino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can feel the optimization already 🏃‍♂️

@austinabell austinabell merged commit f242043 into master Feb 21, 2020
@austinabell austinabell deleted the austin/cbor/cloneremove branch February 21, 2020 18:30
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 this pull request may close these issues.

3 participants