How to reduce startup time for a regular iPhone application?

To be clear, this is for a regular iPhone application, not a game.

I have read several developers around the network several times, mentioning that they are working to improve / reduce the startup time of their applications, but never with any good help on how to do this.

So the question is simple: how can you reduce the launch of iPhone applications?

+6
iphone cocoa-touch
source share
2 answers

Like any other performance issue: use Shark and / or tools to identify bottlenecks in your code, and then focus on how you can speed things up there. Each tool will give you an idea of ​​how much time has been spent on which parts of your code, so the general scheme would be to run the tool at application startup time and then break data to see where performance is occurring.

At the time of launching the application, the most likely candidates for improvement will postpone data loading until it is needed, it is described differently as “on demand” or “lazy” loading. In fact, do not load data at application startup unless you really need it right away when the application loads. In practice, many things that may be needed at some point should not be immediately available when the application starts. For example, if you have a database of N records, but only one of them is visible at a time, do not load all N into memory at application startup. Download any current record, and then load the rest when you need them.

+7
source share

James Thomson made a pleasant blog post, which recorded his attempts to accelerate the launch of PCalc .

Of particular interest is its use of an image with a screenshot from the last launch of the application to pull out the same Default.png trick when loading the rest of the application.

0
source share

All Articles