0

My initial view is quite heavy in terms of UI. I have the main view, a map, and a tableView all in the one view. It takes approximately 30% cpu power on the iPhone 5s to launch this screen (is this bad?) but on the iPhone 4 it takes nearly double that, 50% + cpu power. Im concerned that my app will get killed by the system.

I am drawing most of the views in storyboard, would it be better to programmatically create them rather than using interface builder?

Basically is 30%cpu power high on the iPhone 5s on launch?

It decreases significantly from then on. And how would I accommodate for this on the iPhone 4 series? I realise that the 4 series is likely to be taken off the market in the next few months (with the launch of the 6 Series being predicted and that most apps on the app store say something like "Optimised for iPhone 5."

If I have let anything out please do not hesitate to ask for more information. I hope I have posted this question in the right place also.

DevC
  • 6,982
  • 9
  • 45
  • 80

2 Answers2

1

The percentage CPU being used is irrelevant, for most cases. Your app will be killed if it takes too long to start up, which is time spent loading the storyboard, but it's time that matters, not CPU load as such. Unless you're pegging at 100%, don't worry about it.

Test on the device - if it launches, you're fine.

Building views in code is not necessarily faster or lighter on the CPU than using storyboards.

jrturton
  • 118,105
  • 32
  • 252
  • 268
  • Thanks for the advice. The app launches on both iPhone 5 and iPhone 4. The launch time is much much slower on the iPhone 4, which is likely based on the processor?! My app has a side menu, which gets loaded as the app loads, but is not visible to the user until they press the menu button, like many apps. This probably contributes to the CPU time. – DevC May 12 '14 at 08:04
  • 1
    Yes, it will be slower on a slower device. There's not much you can do about that except profile in instruments and try to optimise whatever is taking all the time - but there's only so much of that you can do. If you need certain things to be done, it's just going to take time. – jrturton May 12 '14 at 08:25
0

It shouldn't crash. If its taking loads out of your CPU, pop up a loading screen, load offscreen, and delegate back to your main and continue onward. An app shouldn't crash loading storyboards.

Schemetrical
  • 5,506
  • 2
  • 26
  • 43
  • Thanks for the tip! I'm relatively new to the scene and havent done much optimisation before so im looking for tips. Is 30% CPU power quite high in your opinion? – DevC May 09 '14 at 09:21
  • IMO, it shouldn't affect anything. 30% isn't much for the phone to handle, and the app will not crash because overuse of CPU in a short period of time is not considered freezing. An app only crashes if a particular task takes too long, the app runs out of memory, or it takes too long to launch. – Schemetrical May 10 '14 at 06:56
  • Thanks for the advice. It launches for both iPhone 5 and iPhone 4 but the iPhone 4 loads much much slower, this is due to the differences in the processor i believe?! My app has a side menu, which gets loaded as the app loads, but is not visible to the user until they press the menu button, like many apps. This probably contributes to the CPU time consumption. – DevC May 12 '14 at 08:06