Closed
Description
Describe the bug
Segment SDK is distributed as a source via SPM.
Upon compilation, a single method func application(_ application: UIApplication?, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)
takes irrationally long time for compiling.
To Reproduce
Steps to reproduce the behavior:
- Compile
iOSLifecycleEvents.swift
with the following flags:
for target in package.targets {
target.swiftSettings = target.swiftSettings ?? []
target.swiftSettings?.append(
.unsafeFlags([
"-Xfrontend", "-warn-long-function-bodies=30", "-Xfrontend", "-warn-long-expression-type-checking=30"
])
)
}
- Observe Xcode warnings
Expected behavior
There should be no longer than usual 0.3 - 0.5 ms of compiling iOSLifecycleEvents.application(didFinishLaunchingWithOptions:)
on M1 family SoC.
Platform (please complete the following information):
- Library Version in use: 1.5.5
- Platform being tested: macOS
- Integrations in use: N/A
Additional context
Using https://github.com/qonto/SwiftCompilationTimingParser it is easier to address such issues, but the approach described with Xcode also works.