views:

80

answers:

2

This may sound like an odd question, but has anyone noticed that their iPhone apps launch quicker when built for distribution over being built for debugging?

Our app initially launches really slowly when compiling it for debugging / running it through xcode. (on device)

So I then dis-connected the phone from xcode and ran some extremely unscientific tests... (To try and quantify the slowness of the app)

  1. Turned iPhone off then on. Booted my app. Counted to 6 mississippi's.
  2. Closed app, re-launched it. Counted to 4 mississippi's.
  3. Turned iPhone off then on. Booted 'contacts' app. Counted to 2 mississippi's.
  4. Closed 'contacts' app, relaunched it. Counted to 2 mississippi's

The reason I compared to the contacts app is that it's pretty similar, UIWise to my own app. (Although its probably doing a lot more than my app is in the background).

My app is a navigation based app and the root view has the following elements:

  • UISearchBar
  • UISwitch
  • UIImageView
  • 3x UILabels.

Not exactly a tasking amount of elements to initially load, so if there isn't a slight speed increase when building for distribution, I need to try and find the cause of whats taking the app so long to load!

One thing I thought could be the issue is that I'm using interface builder for the layout of my view(s). Could I be taking a loading hit as the initial view de-serializes?

Thanks for any input,

Jon

A: 

I've noticed this before. I've always assumed that it has something to do with the iPhone interfacing with the Xcode debugger. I'm just guessing here, but I just tell myself it's telling the iPhone about any breakpoints and what to do when it hits them and stuff, among other "stuff". The iPhone is also probably talking to Xcode about keeping stuff in sync in case of a crash or something.

Neil Daniels
So are you saying that I might get a slight load time decrease when I build for distribution rather than for de-bugging?
JonB
Possibly. Whenever I want to roughly time what my app load times are going to be I:- Build and Go for Release- when it launches automatically, I hit the home button- then I launch my app from the home screen manually, Xcode never knows about itThe one thing this sometimes prevents (unless you're a total ninja at hitting the Home button at the right time) is if you do some type of operations on the very first launch. In that case, I put a passcode lock on the device (and lock it). This will still let Xcode install the app, but it usually cannot launch it. You can then launch it yourself.
Neil Daniels
+1  A: 

It's because the Distribution configuration is usually duplicated from the Release configuration in xcode, and has the "Strip debugger symbols" option turned on. Stripping symbols only used in debugging means there's less to load - which makes it faster.

Jasarien