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

Inline and specialize LambdaHandlers #201

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

fabianfett
Copy link
Member

@fabianfett fabianfett commented Apr 13, 2021

Add @inlinable to default LambdaHandler implementations. This ensures that those implementations can be inlined into user code and can be specialized for their input and output types.

Motivation:

We like speed.

Modifications:

  • Add @inlinable to default protocol implementations

Result:

In my measurement I see another ~4% performance improvement.

@fabianfett fabianfett added this to the 0.5.0 milestone Apr 13, 2021
@fabianfett fabianfett requested a review from tomerd April 13, 2021 22:49
/// `ByteBufferLambdaHandler` factory.
///
/// A function that takes a `InitializationContext` and returns an `EventLoopFuture` of a `ByteBufferLambdaHandler`
public typealias HandlerFactory = (InitializationContext) -> EventLoopFuture<Handler>
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is public we should put a deprecation instead of deleting

Copy link
Contributor

@tomerd tomerd left a comment

Choose a reason for hiding this comment

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

lgtm

@fabianfett fabianfett merged commit 19a9f92 into swift-server:main Apr 14, 2021
@fabianfett fabianfett deleted the ff-inline branch April 14, 2021 20:59
stevapple added a commit to stevapple/swift-tencent-scf-runtime that referenced this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants