Skip to content

Interrupt work of TextFormat::Printer if io::ZeroCopyOutputStream::Next return false #23288

@kpavlov00

Description

@kpavlov00

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions