views:

276

answers:

2

Hi all,

I have an iPhone app (Objective C++). My beta testers - some of them, not all of them - are complaining of slow startup, 7 to 10 seconds. On my device (it's a 3GS), it loads in about 2 sec. On the device simulator - even faster. As things stand now, I cannot even isolate the bottleneck.

Can I somehow slow down the simulator or a fast device? Setting the simulated hardware version to 2.0 does not help.

As a last resort, I could try and borrow an old, slow device from a friend for a night or two. But I'd rather not...

+1  A: 

Aral Balkan links to some nice tools by Mike Shrag that allow you to get the old slow motion simulation mode on triple shift working in SDK 3. Speedlimit - which allows you to throttle network bandwidth might be useful.

martin clayton
Not quite what I'm after... It slows down animations and network access - not performance across the board.
Seva Alekseyev
+2  A: 

If I were you I'd try profiling the startup with Shark - it's hard to profile startup on the device, one way is to put a 5-6 second sleep statement in ApplicationDidFinishLaunching so you have time to attach Shark and start recording, don't make it too long though or the app will be killed!

Also consider what you are doing on startup that might be a lot longer for some people - looking at address records, or things like that.

Kendall Helmstetter Gelner
You should be able to launch the app with Shark so that it starts sampling as soon as the app starts.
lucius
@lucius: how??? Preferably as a separate naswer so that I can accept.
Seva Alekseyev
I don't think it is possible, Shark has no way to start a program on an attached phone. There's an option in XCode to launch the debugger on app start, but nothing as far as I know to launch Shark the same way (and you can't use shark to profile an app the debugger is attached to, otherwise you could break at start).
Kendall Helmstetter Gelner