Skip to content

Use COMPOSITE_CUMULATOR to eliminate memory copy in ByteToMessageDecoder #2739

@loserwang1024

Description

@loserwang1024

Search before asking

  • I searched in the issues and found nothing similar.

Description

Netty has already introduced COMPOSITE_CUMULATOR to eliminate memory copy in ByteToMessageDecoder (netty/netty#3299)

CBB(CompositeByteBuf) has very inefficient indexing mechanism compared to other
ByteBuf impls, so it's basically trade-off between calculation
complexity and memory bandwidth.

But we don't use indexing for ByteBuf, and will read as heap memory in NettyClientHandler. Thus I advice that inner client still use MERGE_CUMULATOR while user client use COMPOSITE_CUMULATOR to reduce useless memory copy.

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions