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

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

Closed
art-divin opened this issue May 4, 2024 · 3 comments · Fixed by #340
Assignees
Labels

Comments

@art-divin
Copy link
Contributor

art-divin commented May 4, 2024

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.

@art-divin art-divin changed the title iOSLifecycleEvents.application(didFinishLaunchingWithOptions:) is Compiled for More than 691 ms iOSLifecycleEvents.application(didFinishLaunchingWithOptions:) is Compiled for More than 400 ms May 4, 2024
@bsneed
Copy link
Contributor

bsneed commented May 5, 2024

Please submit a PR if you'd like to see this changed. The things in there are typed already, urls, strings, etc. It's a basic dictionary.

@bsneed bsneed closed this as completed May 5, 2024
@art-divin
Copy link
Contributor Author

Hello @bsneed , PR is submitted linking against this issue. Thank you ⚡️🔥🔥🔥

@bsneed
Copy link
Contributor

bsneed commented May 5, 2024

Right on! I totally missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants