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
[SR-10755] Application initialization time noticably higher with code compiled with Swift 5 vs Swift 4 toolchain on iOS device #53145
Comments
Can you share your project, even just with Apple at https://bugreport.apple.com? If not, can you share a built IPA for your app? |
Suspicion: Xcode 10.3 is somehow adding a lot more Runtime Search Paths, or this app has so many dynamic libraries that adding one more Runtime Search Path (/usr/lib/swift) caused…well, that seems unrealistic. Most of the time within dyld is spent on |
Comment by Artem Loenko (JIRA) It seems that we have the same issue in Badoo. And, yeah, we have a lot of dynamic libraries. I will try to gather the data for our applications today and attach it to the ticket. |
Comment by Werner Altewischer (JIRA) I created an associated bug at bugreport.apple.com: https://bugreport.apple.com/web/?problemID=51154245 I uploaded the two IPAs used for testing there: one compiled with Swift 5.0 and one compiled with Swift 4.2.1. |
Thanks! |
Comment by Artem Loenko (JIRA) Sorry for the delay, took some time to investigate the problem. We tested the same code-base with Swift 4.2.1/5.0.1 and on iOS 12.1.4/12.3.1. You can check the results on the screenshot below: The strangest thing is that the regression is not "visible" when you ask Right now, we have the following conclusions:
So, I created a radar (51257011) for Apple Xcode/build system team. P.S. the main reason is the same as in the initial description but it is not reproducible on iOS < 12.2 for us:
|
Comment by Artem Loenko (JIRA) wernera77 (JIRA User), hi. Do you have any news about the issue? We found the main reason (in the comments above) but it seems that it is impossible to solve it on our side. So, we are trying to switch to static linking to reduce the regression. |
Attachment: Download
Environment
Xcode 10.2.1 (Swift 5.0.1) vs Xcode 10.1 (Swift 4.2.1)
iPhone 6 Plus iOS 12.1
Additional Detail from JIRA
md5: 5bd354a24a1dabff011cbd391f18d3cc
Issue Description:
We had problems with the app launch time deteriorating quite dramatically when compiling our code base with the Swift 5 toolchain.
Attached is a profile trace for the exact code base, using the same set of dynamic Swift libraries. The only difference is the compiler version: Xcode 10.2.1 with Swift 5.0.1 toolchain vs Xcode 10.1 with the Swift 4.2.1 toolchain.
As you can see in the trace (focus on the initialization part) the swift 5.0.1 version has a 100% CPU block lasting for a few seconds, which is not there with swift 4.2.1.
Testing has been done with an iPhone 6 plus on iOS 12.1, but same issue exist with newer devices (the total time will be reduced there though) and with newer iOS versions (12.2 and 12.3).
Looking at the trace a culprit seems to be calls to realpath (dyld)
Edit: iOS 11 does not seem to exhibit the same problem.
The text was updated successfully, but these errors were encountered: