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 new NIO API for doing synchronous pipeline operations #1149

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Mar 15, 2021

Motivation:

SwiftNIO 2.27.0 added new API which allows channel handlers to be added
synchronously when the caller know they are on the appropriate event
loop. Doing so allows allocations to be saved.

Modifications:

  • Use the synchronous operations helpers where possible.

Result:

Fewer allocations.

Motivation:

SwiftNIO 2.27.0 added new API which allows channel handlers to be added
synchronously when the caller know they are on the appropriate event
loop. Doing so allows allocations to be saved.

Modifications:

- Use the synchronous operations helpers where possible.

Result:

Fewer allocations.
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Mar 15, 2021
@glbrntt glbrntt requested a review from Lukasa March 15, 2021 17:19
@glbrntt glbrntt merged commit 4750840 into grpc:main Mar 15, 2021
@glbrntt glbrntt deleted the gb-sync-pipeline branch March 15, 2021 18:43
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request Apr 8, 2021
Motivation:

We can use synchronous pipeline operations to save some allocations. We
converted to this new API in a handful of places in grpc#1149 but this one
was missed.

While NIOs async pipeline operations now use synchronous operations
where possible (i.e. if already on the right event loop), they rely on having
a cached void future to save allocations. This isn't yet supported by
NIOTS, so we'll only save allocations there.

Modifications:

- Synchronously configure the client connection channel pipeline

Result:

Fewer allocations (when using NIOTS).
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request Apr 8, 2021
Motivation:

We can use synchronous pipeline operations to save some allocations. We
converted to this new API in a handful of places in grpc#1149 but this one
was missed.

While NIOs async pipeline operations now use synchronous operations
where possible (i.e. if already on the right event loop), they rely on having
a cached void future to save allocations. This isn't yet supported by
NIOTS, so we'll only save allocations there.

Modifications:

- Synchronously configure the client connection channel pipeline

Result:

Fewer allocations (when using NIOTS).
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request Apr 8, 2021
Motivation:

We can use synchronous pipeline operations to save some allocations. We
converted to this new API in a handful of places in grpc#1149 but this one
was missed.

While NIOs async pipeline operations now use synchronous operations
where possible (i.e. if already on the right event loop), they rely on having
a cached void future to save allocations. This isn't yet supported by
NIOTS, so we'll only save allocations there.

Modifications:

- Synchronously configure the client connection channel pipeline

Result:

Fewer allocations (when using NIOTS).
glbrntt added a commit that referenced this pull request Apr 8, 2021
Motivation:

We can use synchronous pipeline operations to save some allocations. We
converted to this new API in a handful of places in #1149 but this one
was missed.

While NIOs async pipeline operations now use synchronous operations
where possible (i.e. if already on the right event loop), they rely on having
a cached void future to save allocations. This isn't yet supported by
NIOTS, so we'll only save allocations there.

Modifications:

- Synchronously configure the client connection channel pipeline

Result:

Fewer allocations (when using NIOTS).
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