大型应用程序的 iPhone 应用程序加载时间
我正在尝试寻找减少大型应用程序加载时间的方法。 这是一些背景: 该应用程序使用了大量的 iPhone 框架(openGL、mapping、location、quartz、audio)以及其他来源的一些库(JSON、ARKit、Flurry、Facebook connect) 代码 + nib 大小约为 3.5MB,包含约 150 个源文件。 该应用程序压缩至约 2.5MB。 iPhone 3GS 上的加载时间约为 13 秒。我的代码实际花费的时间只有1s左右。 (从main()开始到applicationDidFinishLaunching结束) 应用程序委托引用了应用程序中的大多数视图控制器,因为它们是从许多地方引用的,并且通常存储持久信息。 应用程序中的所有内容都已延迟初始化,因此我不能稍后再做事情。
在这种情况下,我可以采取什么措施来减少加载时间,或者这就是设备将所有代码加载到内存中所需的时间?我不太了解编译器/链接器如何工作,所以我想知道是否有任何编码实践可以减少加载时间?
I'm trying to find ways to reduce load times for a large application.
Here is some background:
The app uses a lot of the iphone frameworks (openGL,mapping,location,quartz,audio) as well a few libraries from other sources (JSON, ARKit, Flurry, Facebook connect)
The code + nib size is around 3.5MB with about 150 source files.
The app compresses to around 2.5MB.
Load times are around 13s on an iPhone 3GS. The actual time spent in my code is only around 1s. (from the start of main() to the end of applicationDidFinishLaunching)
The app delegate has references to most of the view controllers in the app as they are referenced from many places and often store persistent information.
Everything in the app is already lazily initialised so I can't just do things later on.
Is there anything I can do to reduce the load times in this case or is this just how long the device takes to load all the code into memory? I don't know very much about how compilers/linkers work so I was wondering if there are any coding practices that can reduce load times?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
13秒太不可思议了。链接到几个库应该不会花费那么多时间。
请注意,在连接到调试器时运行它会使启动速度变慢,因为 GDB 会花一些时间查找符号或类似的东西。
13 seconds is incredible. Linking to a few libraries should not take that much time.
Note that running it while attached to the debugger will make launching slower, because GDB spends a while looking up symbols or something like that.