Files
swift-nio/Sources/NIO
Johannes Weiss 578e6d4bef don't use variable initialisation outside of init (#1235)
Motivation:

The Swift compiler actively tries to make our live hard and puts all
initialisations of variables that are initialised using the shorthand
syntax

    @usableFromInline var myVar: MyVarType = .init()

into a _non-inlinable_ function

     variable initialization expression of MyModule.MyType.myVar : MyVarType

This means that the following pattern

    public struct MyType {
        @usableFromInline var myVar: MyVarType = .init()

        @inlinable public init() {
        }
    }

leads to code for the `init` that looks like

    CALL variable_initialization_expression_...

instead of also inlining the the code for the variable initialiser.

Modifications:

Don't use `@usableFromInline var myVar: MyVarType = ...` anywhere,
instead put it explicitly into the @inlinable `init`s which makes
actually inlinable.
I even removed that syntax from places where it doesn't matter
(eg. non-@inlinable inits) for consistency and in case someone were to
make the init inlinable later.

Result:

Minor performance wins working around https://bugs.swift.org/browse/SR-11768
2019-11-12 15:11:32 +00:00
..
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-02-01 15:34:59 +00:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2019-10-16 22:06:55 -07:00
2018-12-07 21:15:34 +00:00