Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dataflow Streaming] Optimize serialization of small commits #34355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arunpandianp
Copy link
Contributor

@arunpandianp arunpandianp commented Mar 20, 2025

Prior to this change all commit chunks were serialized first and then sent to GRPC layer as StreamingCommitRequestChunk.
With this change small commits that don't span chunks are sent as it is without the intermediate serialization using StreamingCommitRequestChunkOverlay to GRPC layer. #33578

Example old profile:
image

Example new prrofile: image

@arunpandianp
Copy link
Contributor Author

R: @scwhittle

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@arunpandianp
Copy link
Contributor Author

Run PreCommit Java

@scwhittle
Copy link
Contributor

Beyond profile difference, did you see cpu usage drop with the PR? kind of hard to tell from profiles other than that it moved locations.

Some benefits does seem like it would reduce memory since we don't have serialized commit in addition to grpc message frames which might get sent. Downside is that we are now serializing beneath the synchronized block for the stream which seems like it could cause some more contention if there are multiple commit threads since they just pull randomly from commit stream pool and may overlap. If this also helps cpu maybe that is moot.

COMMIT_METHOD_DESCRIPTOR =
MethodDescriptor.<CommitRequest, StreamingCommitResponse>newBuilder()
.setFullMethodName(getCommitWorkStreamMethod().getFullMethodName())
.setIdempotent(getCommitWorkStreamMethod().isIdempotent())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do getCommitWorkStreamMethod().toBuilder() and just override what you need? then it's simpler and we don't have to worry about missing over new things added.

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

Successfully merging this pull request may close these issues.

2 participants