ios 应用程序加载时间慢

发布于 2024-11-17 14:23:04 字数 163 浏览 2 评论 0原文

我有一个应用程序,其中包含大量尺寸合适的图像。目前所有图像都在主应用程序包中。当应用程序加载时,大约需要两秒钟的时间才能将登陆图像替换为实际的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泛泛之交 2024-11-24 14:23:04

实际的可执行文件包含在捆绑包内(就像 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:

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.”

妄想挽回 2024-11-24 14:23:04

将图像放在不同的包中不会加快应用程序的启动速度。相反,您应该考虑延迟加载优化。仅在需要时加载您需要的内容。

什么是延迟加载?

如何延迟加载?

优化 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文