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 sync options when creating a stream channel #283

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Mar 15, 2021

Motivation:

SwiftNIO 2.27.0 added synchronous channel options. We can use these if
available when creating a stream channel to avoid a future allocation.

Modifications:

  • 'getAutoReadFromParent' is synchronous when possible and now takes a
    closure to handle the result.
  • Update allocation counts (and sort them to make updating them easier,
    this also includes switching the order we run test_1k_requests
    interleaved and noninterleaved)

Result:

Fewer allocations.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Mar 15, 2021
Motivation:

SwiftNIO 2.27.0 added synchronous channel options. We can use these if
available when creating a stream channel to avoid a future allocation.

Modifications:

- 'getAutoReadFromParent' is synchronous when possible and now takes a
  closure to handle the result.
- Update allocation counts (and sort them to make updating them easier,
  this also includes switching the order we run test_1k_requests
  interleaved and noninterleaved)

Result:

Fewer allocations.
@glbrntt glbrntt force-pushed the gb-use-sync-options branch from 946faab to b8cf750 Compare March 15, 2021 13:54
@glbrntt glbrntt marked this pull request as ready for review March 15, 2021 14:11
@glbrntt glbrntt requested a review from Lukasa March 15, 2021 14:11
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

@glbrntt glbrntt merged commit e7af013 into apple:main Mar 16, 2021
@glbrntt glbrntt deleted the gb-use-sync-options branch March 16, 2021 10:10
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
Development

Successfully merging this pull request may close these issues.

2 participants