ios 应用程序加载时间慢
我有一个应用程序,其中包含大量尺寸合适的图像。目前所有图像都在主应用程序包中。当应用程序加载时,大约需要两秒钟的时间才能将登陆图像替换为实际的 UI。 加载时间与捆绑包大小有关,即主捆绑包较小会减少加载时间吗? 将图像放在另一个包中是否会减少加载时间,或者加载多个包的开销实际上是否有害?
谢谢
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 seconds 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际的可执行文件包含在捆绑包内(就像 OS X 应用程序包中的捆绑包)。 捆绑包实际上只是将所有资源打包在一起的一种方式,它的大小不应影响应用程序的加载时间。应用程序运行时不会加载这些资源(除非您正在执行某些操作)加载它们)。
http://developer.apple.com/ Library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html
捆绑包实际上只是一个目录:
并且您应该包含所有图像:
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:
And you should include all of your images:
将图像放在不同的包中不会加快应用程序的启动速度。相反,您应该考虑延迟加载优化。仅在需要时加载您需要的内容。
什么是延迟加载?
如何延迟加载?
优化 iPhone 应用程序启动时间
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