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

Reduce amount of copying/cloning within the transformation from StreamerMessage to codec::Block #10

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

maoueh
Copy link
Contributor

@maoueh maoueh commented Aug 18, 2022

We were passing the top element as a reference as well as a bunch of other inner structures. This was causing unnecessary cloning of elements because we didn't had ownership of the top-level structure. We actually "own" the StreamerMessage which is dropped right after the transformation so it makes more sense to move it into the transformer and move as much value straight inside the proto instead of deeply cloning.

So, everything is now "moved" which means much less data need to be copied/created and mostly everything can be simply be "moved" in the right location. There was also useless usage of clone here and there which was doubly not required.

…amerMessage` to `codec::Block`

We were passing the top element as a reference as well as a bunch of other inner structures. This was causing unecessary cloning of elements but we didn't had ownership of the top-level structure. However this was pretty bad because we actually "own" the `StreamerMessage` which is dropped right after the transformation.

So, everything is now "moved" which means much less data need to be copied/created and mostly everything can be simply be "moved" in the right location. There was also useless usage of `clone` here and there which was doubly not required.
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.

1 participant