测量iPhone应用程序的加载时间 [英] Measuring iPhone application load time

查看:91
本文介绍了测量iPhone应用程序的加载时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以非常短的加载时间优化iPhone应用程序,并且想知道:

是否有一种方法可以测量从用户点击图标到应用可用(或至少–viewDidLoad被调用)到iPhone应用的加载时间?

理想情况下,这可以在设备和模拟器中使用,但是如果有人找到了一种专门在模拟器中测量时间的方法,那么这至少是一个起点.

没有; 秒表"或一个密西西比州,两个密西西比州"不计算在内. :-)

解决方案

作为WWDC 2016的一部分,Apple宣布了一个新的环境变量,作为beta 2的一部分,它将帮助您记录应用程序的启动时间. /p>

上述答案的一个问题是,它们没有考虑到主时间,即加载图像,进行变基和绑定修复的时间.

如果添加变量 DYLD_PRINT_STATISTICS = 1您将在控制台中打印出主要时间.

WWDC 2016的Session 406讨论了这种变量用法以及如何解释结果.

I am in the process of optimizing an iPhone app for very short load time and am wondering:

Is there a means of measuring the load time of an iPhone app from the time the user taps the icon to the time that the app is usable (or at least –viewDidLoad gets called)?

Ideally this would work in the device and simulator, but if someone has found a way to measure this time exclusively in the simulator that would at least be a starting point.

And no; "stopwatch" or "one Mississippi, two Mississippi" do not count. :-)

解决方案

As part of WWDC 2016 Apple announced a new environment variable, available as part of beta 2, which will help you to record the launch time of an application.

One issue with the answers above is they do not take into account the pre-main time, where images are loaded and rebase and binding fixups take place.

If you add the variable DYLD_PRINT_STATISTICS = 1 you will get the pre-main time printed in the console.

Session 406 from WWDC 2016 goes into this variable usage and how to interpret the results.

这篇关于测量iPhone应用程序的加载时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆