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] replace OutputStreamWriter with custom ByteStringAppendable in encodeKey #33735

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arunpandianp
Copy link
Contributor

@arunpandianp arunpandianp commented Jan 23, 2025

OutputStreamWriter is thread safe and has synchronization overhead. Each OutputStreamWriter allocates a 512 byte buffer which is not useful when writing in-memory ByteStrings.

The buffer allocations show up starkly on cpu profiles.

Screenshot 2025-01-22 at 8 37 55 PM

#33578

…gAppendable

OutputStreamWriter is thread safe and has synchronization overhead.
Each OutputStreamWriter allocates a 512 byte buffer which is
useful when writing inmemory ByteStrings.
@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 arunpandianp changed the title [Dataflow Streaming] replace OutputStreamWriter with custom ByteStringAppendable [Dataflow Streaming] replace OutputStreamWriter with custom ByteStringAppendable in encodeKey Jan 23, 2025
@arunpandianp
Copy link
Contributor Author

Run Java PreCommit

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.

1 participant