Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

application slow launch / startup time on device

Hi,

I have an app that seems to load very slowly on startup, I'm counting about 5 seconds from touching the icon until my main view loads.
I'm not doing anything spectacular in my code, basically loading a few views from xibs (nothing complicated) and loading some very small data (mainly some state) from the filesystem.
The simulator does not seem to suffer from this and the app starts immediately.
I'm aware of the "Default.png" work around but still it seems very strange.
What can I be missing?
Should I get rid of the xibs and initialize my views programatically?
Can anyone post his/her's startup times?
kindest regards,
--tzurs

imac 24'', Mac OS X (10.5.4)

Posted on Aug 29, 2008 4:21 AM

Reply
7 replies

Aug 29, 2008 4:42 AM in response to tzurs

You can try starting it up with Instruments or scattering profiling code throughout it, but a lot of this seems to be a function of the OS: before control ever reaches your program, iPhone OS performs several seconds of processing. My best guess is that it's verifying all the signatures and stuff, but it's hard to know exactly what it's up to.

Sep 19, 2008 9:22 AM in response to Blondie7575

The device is A LOT slower than the simulator. As a test, do a "Release" build to the device. After it starts up, exit. Then startup without the debugger. It should be a little faster.

Startup on the device while connected to the debugger is slower than it will be in "real life".

Another good test - put a breakpoint at the start on "main". You will then see how long your app takes to just get loaded by the device. Now you can see how much time is spent just starting your app and how long it takes to create and display your first view.

Sep 19, 2008 9:32 PM in response to RickMaddy

Thanks RickMaddy, but I have done those tests. The 5-6 second delay occurs before hitting the first line of main. It is roughly 5-6 seconds even in Release builds run directly on the device with no debugger connection. Very frustrating!

Does anyone know what variables most affect application loading time? Is it loading images, setting up views, all of the above? Is loading multiple smaller xibs worse than a single large xib? Is creating views with code quicker than loading them from an xib? I've tried to test all these variables in isolation, but can't find any consistent patterns.

The documentation is silent on the subject of load times, and Instruments tells me all the time is in
some anonymous system dylib.

Sep 19, 2008 10:35 PM in response to Blondie7575

If the 5-6 delay is before the first line of main then it's not really anything you are doing in your app. As I understand it (would could be wrong of course), no images or xib are loaded until the UIApplication line in main is called.

Are you linking in a lot of frameworks? That could be a source of slow app loading. Or maybe one of the frameworks you are using is big and adds to the overhead.

Just as a comparison, have you tried these tests with an empty, new project template? Then start adding each framework used by your real app one at a time. You may need to add a line or two of code - enough to ensure the framework is linked in.

Sep 20, 2008 4:52 PM in response to RickMaddy

*forehead smack*

Actually, it turns out I was setting my breakpoint in the wrong place. The bulk of the delay was all between my main() and my top view's viewDidLoad. In other words, it's my xib loading and view setup that is slow.

I split my views into multiple XIBs, and now load them lazily (the correct way 🙂 ) and things are much improved.

Thanks for your tips, RickMaddy!

application slow launch / startup time on device

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.