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

Save an allocation in BufferedStream #1991

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

gjcairo
Copy link
Collaborator

@gjcairo gjcairo commented Jul 24, 2024

Motivation

One of the backing types is unnecessarily a class.

Modifications

Turned the class into a struct and marked the setter for a computed var as nonmutating (to preserve Sendability).

Result

One less allocation per BufferedStream

@gjcairo gjcairo requested a review from glbrntt July 24, 2024 15:27
@gjcairo gjcairo added the v2 A change for v2 label Jul 24, 2024
@gjcairo gjcairo merged commit 899c121 into grpc:main Jul 24, 2024
15 of 17 checks passed
@gjcairo gjcairo deleted the extra-alloc-bufferedstream branch July 24, 2024 15:48
clintonpi pushed a commit to clintonpi/grpc-swift that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 A change for v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants