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 indirection between channel and multiplexer #126

Merged
merged 1 commit into from
May 17, 2019

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented May 17, 2019

Motivation:

Previously the HTTP2StreamChannel forwarded all frames to the parent
Channel by way of the abstract Channel existential API. While this was
straightforward, it added unnecessary overhead due to the extra pipeline
steps and the extra indirection of the types providing an inlining
barrier.

Given that in #116 we gave the HTTP2StreamChannel a reference to its
parent multiplexer, we may as well take advantage of this and allow
direct calls from the stream channel into the multiplexer.

Modifications:

Avoided calls to parent.write and parent.flush.
Replaced them with a new interface.

Result:

Slightly better performance.

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label May 17, 2019
@Lukasa Lukasa added this to the 1.2.1 milestone May 17, 2019
@Lukasa Lukasa requested a review from weissi May 17, 2019 16:06
@Lukasa Lukasa force-pushed the cb-avoid-channel-indirection branch from 464cf52 to aa14db6 Compare May 17, 2019 17:28
Motivation:

Previously the HTTP2StreamChannel forwarded all frames to the parent
Channel by way of the abstract Channel existential API. While this was
straightforward, it added unnecessary overhead due to the extra pipeline
steps and the extra indirection of the types providing an inlining
barrier.

Given that in apple#116 we gave the HTTP2StreamChannel a reference to its
parent multiplexer, we may as well take advantage of this and allow
direct calls from the stream channel into the multiplexer.

Modifications:

Avoided calls to parent.write and parent.flush.
Replaced them with a new interface.
Added new allocation test for this path.

Result:

Slightly better performance.
@Lukasa Lukasa force-pushed the cb-avoid-channel-indirection branch from aa14db6 to 9bedd22 Compare May 17, 2019 17:51
@Lukasa Lukasa requested a review from weissi May 17, 2019 17:51
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

great! lgtm

@Lukasa Lukasa merged commit 2d5ab32 into apple:master May 17, 2019
@Lukasa Lukasa deleted the cb-avoid-channel-indirection branch May 17, 2019 17:58
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