Skip to content

iOSLifecycleEvents.application(didFinishLaunchingWithOptions:) is Compiled for More than 400 ms #339

Closed
@art-divin

Description

@art-divin

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:

  1. 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"
  ])
)
}
  1. 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.

Screenshots
image

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions