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

[Substrait] Review construction of nested protobufs in Export.cpp #826

Open
ingomueller-net opened this issue May 15, 2024 · 0 comments
Open

Comments

@ingomueller-net
Copy link
Collaborator

ingomueller-net commented May 15, 2024

Is there a way we could avoid make_unique's here? (well more the memory allocation parts here if this done often).

You are touching upon a question I had pending in my head: what is the best practice to assemble nested protobufs. I searched both internal and external doc and couldn't find any clear answers.

It sound plausible that using std::make_unique and set_allocated_* entails more allocations than necessary. I suppose that the better alternative is to use something like:

Inner* inner = outer->mutable_inner();
inner->set_primite(...);

If that is the case, then I'd have to restructure the whole file, so I'd like to be sure what is the best approach before starting. Can you confirm or have a good resource on the top of your head?

Originally posted by @ingomueller-net in #817 (comment)

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

1 participant