Skip to content

Added Drainable implementation to ProtoInputStream#2055

Open
laoqiu233 wants to merge 1 commit intoscalapb:masterfrom
laoqiu233:drainable_stream
Open

Added Drainable implementation to ProtoInputStream#2055
laoqiu233 wants to merge 1 commit intoscalapb:masterfrom
laoqiu233:drainable_stream

Conversation

@laoqiu233
Copy link

@laoqiu233 laoqiu233 commented Feb 10, 2026

The current default output stream that the scalapb marshaller uses does not support the Drainable interface from grpc-java, which becomse a problem here where high performance code are expected to support it to avoid copying of the serialized protobuf.

This relatively simple fix allowed us to optimize a performance critical and high throughput service, and after deploying it to production we managed to cut a few GB of heap usage in the runtime and significantly lowered the heap presuure, but we did not get noticible benefit in timings. (Although for bigger protobuf messages it could make the timings a lot better by avoiding the copying)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant