pybind / pybind11_protobuf

Pybind11 bindings for Google's Protocol Buffers
Other
56 stars 34 forks source link

Whats the advantage of using pybind11_protobuf over just passing a serialised message string instead? #80

Closed indraneelpatil closed 2 years ago

indraneelpatil commented 2 years ago

Hi!

Thanks for the great work! In my project I need to pass a protobuf message between python and a C++ function installed as a module using pybind. I am just curious as to, for such a scenario why would someone resort to using this instead of just using string arguments?

I am guessing speed could be one factor but how big do the protobuf messages need to be to really make a difference in speed?

Thanks, Indraneel

rwgk commented 2 years ago

It depends on your priorities:

Depending on how much weight you put on each, avoiding the pybind11_protobuf dependency might be a good decision, or a non-starter.

indraneelpatil commented 2 years ago

Thanks for the answer! Helps a lot :)