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:
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 https://github.com/iree-org/iree-llvm-sandbox/pull/817#discussion_r1601225353_