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

Mark public generic async methods inlinable #426

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

rnro
Copy link
Contributor

@rnro rnro commented Oct 25, 2023

Mark public generic async methods inlinable

Motivation:

Mark generic async methods inlinable where possible to improve performance.

Modifications:

Multiple methods marked @inlinable

Result:

Performance increase

rnro added 2 commits October 25, 2023 17:04
Motivation:

Mark generic async methods inlinable where possible to improve performance.

Modifications:

Multiple methods marked `@inlinable`

Result:

Performance increase
struct MultiplexerAbstractChannel {
private(set) var baseChannel: HTTP2StreamChannel
@usableFromInline var _baseChannel: HTTP2StreamChannel
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be mistaken but I think you can apply @usableFromInline to a private(set) var (but not a private var)

}
}

extension MultiplexerAbstractChannel: Equatable {
@usableFromInline
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@usableFromInline
@inlinable

}
}

extension MultiplexerAbstractChannel: Hashable {
@usableFromInline
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@usableFromInline
@inlinable

@rnro rnro requested a review from glbrntt October 30, 2023 09:12
@rnro rnro merged commit a6c66bc into apple:main Oct 30, 2023
@rnro rnro deleted the mark_generic_async_methods_inlinable branch October 30, 2023 09:30
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jan 22, 2024
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