Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Dynamic frameworks load time? #491

Closed
marcelofabri opened this issue Aug 3, 2015 · 16 comments
Closed

Dynamic frameworks load time? #491

marcelofabri opened this issue Aug 3, 2015 · 16 comments

Comments

@marcelofabri
Copy link

I'm seeing large load times when using dynamic frameworks on my app and decided to check if this was an issue for you guys too.

I could reproduce the issue on an iPad 3 here and sometimes the app won't even launch due to the WatchDog. Am I missing something here? Do you really suffer from this issue too?

This seems to be the same issue as artsy/eigen#586.

@orta
Copy link
Contributor

orta commented Aug 3, 2015

Are you on iOS9?

@marcelofabri
Copy link
Author

iOS 8.1

@orta
Copy link
Contributor

orta commented Aug 3, 2015

We definitely saw a longer launch time for eigen, it was significant on iOS 9 devices ( after being compiled and deployed from Xcode 6 ) but it wasn't worrying on eigen ( which has way more Pods ) for the last release.

@ashfurrow
Copy link
Contributor

I've seen long launch times, but nothing that would stop the app from launching. Maybe the hardware we run on is fast enough. Iit hasn't been a pressing issue for us on this app since it's an internal tool.

@marcelofabri
Copy link
Author

Aug 3 17:05:29 iPad-3-iOS-81 ReportCrash[495] : net.artsy.kiosk.beta failed to launch in time
Aug 3 17:05:29 iPad-3-iOS-81 ReportCrash[495] : Elapsed total CPU time (seconds): 22.320 (user 22.320, system 0.000), 55% CPU

I'm wondering how aren't there more people talking about this problem on their apps.

I mean, we're almost dropping dynamic frameworks because of this. I also opened a DTS with Apple to see if there's any official word on this.

@ashfurrow
Copy link
Contributor

I think @alloy did some testing on eigen and the problem primarily affects debug builds. There's also a helpful command there to shorten the time.

@marcelofabri
Copy link
Author

Yeah, I checked that, but I'm also seeing the issue on release builds. Also, if I understood correctly, that command will statically link all frameworks and (I think) Swift frameworks need to be dynamically linked.

@brianmichel
Copy link

I've been seeing this recently in our app as well, doing some more investigating and lead me here. You are not alone :)

@orta
Copy link
Contributor

orta commented Aug 31, 2015

I don't think we have either: Asked on the Apple Dev Forums, or done a DTS support ticket. Both would expand the surface area of people who might be in the know about ways around it.

Other ideas, @neonacho pointed me at https://github.com/johnno1962/Accelerator last night

@marcelofabri
Copy link
Author

Here is our DTS response:

Thank you for contacting Apple Developer Technical Support (DTS).

I discovered that these long load times only happen when the debugger is attached. If you select Product > Profile and look at the console in Instruments instead, you will notice the time is in milliseconds instead of seconds.

dyld reports a higher time when the debugger is attached because the debugger halts execution after each framework is loaded in order to gather information. That time that the process is halted counts against the dyld load time because dyld uses mach_absolute_time() to record the time at the start and end of loading frameworks and then prints the difference.

If you are seeing poor framework loading performance without a debugger attached, please file a bug so our dyld engineers can take a look. Combining frameworks may reduce the loading time, but you will hit a lower bound of frameworks since you can’t combine the Swift frameworks bundled with your app.

However, our app still takes 8s to load (7.4s on "total images loading time"). I just responded to the DTS and I'm waiting for a response. On the meantime, I'll test https://github.com/johnno1962/Accelerator.

@alloy
Copy link
Contributor

alloy commented Aug 31, 2015

@marcelofabri Yeah that’s basically the same as reported on the Eigen thread. In our case startup is a bit slower the first time you launch the app, thereafter it goes smoother.

@alloy
Copy link
Contributor

alloy commented Aug 31, 2015

@marcelofabri Keep us posted of your communication please! ❤️

@marcelofabri
Copy link
Author

Here's what I was able to measure on our project about total images loading time:

First Time Second Time
Dynamic frameworks 7.3 seconds (91.0%) 66.74 milliseconds (9.5%)
Accelerator 7.7 seconds (90.6%) 43.50 milliseconds (7.8%)

@johnno1962
Copy link

Bother.. In the finish I only see the speedup on static linking using Accelerate in the debugger too. Well, at least this is one approach we can eliminate!

@alloy
Copy link
Contributor

alloy commented Sep 1, 2015

@johnno1962 I love your try it and eliminate hands-on approach, thanks for your efforts and input! ❤️

@orta
Copy link
Contributor

orta commented Dec 27, 2016

This eventually came to a conclusion in 9.3 - see the eigen issue for full details

@orta orta closed this as completed Dec 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants