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

{trpc, attachment}: pre-check empty attachment while getting or setting to avoid memory allocation #74

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

liuzengh
Copy link
Contributor

  • return false if getting empty attachment to avoid memory allocation in io.ReadAll
  • set non-nil server request attachment to avoid memory allocation
  • rename: GetClientRequestAttachment => ClientRequestAttachment, GetServerResponseAttachment => ServerResponseAttachment

to avoid memory allocation.

- return false if getting empty attachment to avoid memory allocation in io.ReadAll
- set non-nil server request attachment to avoid memory allocation
- rename: GetClientRequestAttachment => ClientRequestAttachment, GetServerResponseAttachment => ServerResponseAttachment
Copy link
Contributor

@WineChord WineChord left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@WineChord WineChord left a comment

Choose a reason for hiding this comment

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

LGTM

@sandyskies sandyskies merged commit b4e1161 into trpc-group:main Oct 12, 2023
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants