What language does this apply to?
main
c++
Describe the problem you are trying to solve.
Now TextFormat::Printer continue iterate throughth fields event when io::ZeroCopyOutputStream::Next return false, this work is pointless and may be very performance expensive for huge protobuf messages.
For example we want print only head of protobuf message, limiting output size (e.g. first 1024 bytes).
Describe the solution you'd like
Stop iterate throughth fields if io::ZeroCopyOutputStream::Next return false.
Describe alternatives you've considered
Now we implement own ZeroCopyOutputStream and throw exception from io::ZeroCopyOutputStream::Next instead returning false.
Additional context
What language does this apply to?
main
c++
Describe the problem you are trying to solve.
Now TextFormat::Printer continue iterate throughth fields event when
io::ZeroCopyOutputStream::Nextreturn false, this work is pointless and may be very performance expensive for huge protobuf messages.For example we want print only head of protobuf message, limiting output size (e.g. first 1024 bytes).
Describe the solution you'd like
Stop iterate throughth fields if
io::ZeroCopyOutputStream::Nextreturn false.Describe alternatives you've considered
Now we implement own
ZeroCopyOutputStreamand throw exception fromio::ZeroCopyOutputStream::Nextinstead returning false.Additional context