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

Remove a few unnecessary allocations. #243

Merged
merged 2 commits into from
Sep 22, 2020
Merged

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Sep 22, 2020

Motivation:

Unnecessary allocations are bad!

Modifications:

  • Use 'removeAll' instead of allocating a new buffer when dropping
    pending reads in the 'HTTP2StreamChannel'
  • Use a static empty buffer in 'DataBuffer.evacuatePendingWrites'

Result:

@glbrntt glbrntt requested a review from Lukasa September 22, 2020 08:37
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Sep 22, 2020
Motivation:

Unnecessary allocations are bad!

Modifications:

- Use 'removeAll' instead of allocating a new buffer when dropping
  pending reads in the 'HTTP2StreamChannel'
- Use a static empty buffer in 'DataBuffer.evacuatePendingWrites'

Result:

- Fewer allocations.
- Resolves apple#240
- Resolves apple#241
@Lukasa Lukasa merged commit cee48fd into apple:master Sep 22, 2020
@glbrntt glbrntt deleted the gb-minor-perf branch September 22, 2020 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
2 participants