grpc / grpc/grpc-java

Slowness with large payloads

Open
#2,151 8 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

When reading a proto off the wire, Netty Passes the chunks of data read up to the message deframer, which stores them in a composite byte buffer. It passes this composite as an InputStream to CodedInputStream for decoding, which itself makes many copies.

It seems like it would be more efficient to pre allocate a buffer of the appropriate size (since we know the message length) and concat to it each chunk that netty passes up. This would be a copy, but it would make it so that CIS doesn't have to copy in its inefficient manner.

This would also free up the buffers Netty uses to read chunks of data off of the wire more quickly.

Discovered when trying to max out a very high speed network link.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.