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

Avoid an error allocation in the server stream handler #1970

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jul 5, 2024

Motivation:

Existential errors unconditionally allocate. In the server stream handler a promise is failed on tear down via an API which takes an existential error. This means the handler always allocates, even if the promise has been completed.

Modifications:

  • Statically allocate the error as an existential

Result:

Fewer allocations

Motivation:

Existential errors unconditionally allocate. In the server stream
handler a promise is failed on tear down via an API which takes an
existential error. This means the handler always allocates, even if the
promise has been completed.

Modifications:

- Statically allocate the error as an existential

Result:

Fewer allocations
@glbrntt glbrntt requested a review from gjcairo July 5, 2024 09:49
@glbrntt glbrntt added the v2 A change for v2 label Jul 5, 2024
@glbrntt glbrntt enabled auto-merge (squash) July 5, 2024 10:21
@glbrntt glbrntt merged commit 595a416 into grpc:main Jul 5, 2024
17 checks passed
@glbrntt glbrntt deleted the avoid-server-stream-error-alloc branch July 5, 2024 10:35
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.

2 participants