开发者

ios slow app load times

开发者 https://www.devze.com 2023-03-16 03:37 出处:网络
I have an app that has quite a large number of good sized images in it. Currently all the images are in the main application bundle. When app loads it takes about two se开发者_StackOverflowconds for t

I have an app that has quite a large number of good sized images in it. Currently all the images are in the main application bundle. When app loads it takes about two se开发者_StackOverflowconds for the landing image to be replaced with the actual UI. Is load time related to bundle size, i.e. would having a smaller main bundle decrease load times? Would placing the images in another bundle decrease load time or is the overhead of loading more then one bundle actually detrimental?

Thanks


The actual executable file is contained inside the bundle (like bundles in an OS X application's package). The bundle is really just a way of packaging all your resources together and it's size shouldn't affect your application's load time. Those resources aren't getting loaded when the app is run (unless you are doing something to load them).

http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html

A bundle is really just a directory:

A bundle is a directory with a standardized hierarchical structure that holds executable code and the resources used by that code.

And you should include all of your images:

Applications should always include all of the images, strings files, localizable resources, and plug-ins that they need to operate [inside the bundle]. Noncritical resources should similarly be stored inside the application bundle whenever possible but may be placed outside the bundle if needed. For more information about the bundle structure of applications, see “Application Bundles.”


Placing the images in a different bundle will not speed up app launch. Instead you should look at lazy loading optimization. Only load what you need when you need it.

What is Lazy Loading?

How to lazy load?

Optimizing iPhone Application Launch Time

0

精彩评论

暂无评论...
验证码 换一张
取 消