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

Use ValueFromIncomingContext() to reduce allocations and copying #723

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

ash2k
Copy link
Contributor

@ash2k ash2k commented Aug 30, 2024

Changes

This function is more memory efficient as it doesn't copy all of the metadata key-values, only what is requested.

Docs https://pkg.go.dev/google.golang.org/grpc/metadata#ValueFromIncomingContext.

Verification

Unit tests.

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

LGTM

@johanbrandhorst johanbrandhorst merged commit 9774bef into grpc-ecosystem:main Aug 31, 2024
7 checks passed
@johanbrandhorst
Copy link
Collaborator

Thanks for this!

@ash2k ash2k deleted the ValueFromIncomingContext branch August 31, 2024 11:34
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.

2 participants