Skip to content

Use CodedInputStream.newInstance(ByteBuffer) for non-segmented messages #2937

Open
@ejona86

Description

@ejona86

This is to improve the decode performance of small messages (<16 KB) to avoid a message-sized allocation and copy.

Protobuf already has an optimized code path for decoding a direct ByteBuffer. We currently copy to a byte[], but that could be avoided because small messages will commonly be in a single ByteBuffer.

This will require adding a new interface for retrieving the ByteBuffer from the InputStream. I'm uncertain whether the interface should support returning multiple ByteBuffers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions