iPhone 的线路电平分析 [英] Line Level Profiling for iPhone

查看:48
本文介绍了iPhone 的线路电平分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来了解在 iPhone 上运行时我的每个程序的源代码行花费了多少时间.类似于 Shark 在方法/功能级别上可以提供的内容.使用标准工具可以做到这一点吗?有没有第三方工具可以提供这种粒度?

I'm looking for a way to find out how much time is spent in each of my program's source line when running on the iPhone.Similar to what Shark can provide on the method/function level. Is this possible with the standard tools? Are there 3rd party tools that can provide this sort of granularity?

没有必要为要收集的项目中的每一行源代码分析数据.理想情况下,可以选择特定的方法或函数来分析其性能.

It wouldn't be necessary for profiling data for every line of source code in the project to be collected. Ideally one would be able to select specific methods or functions whose performance would be analyzed.

推荐答案

这个 link 讨论了如何在 iPhone 应用程序上收集跟踪数据,其中包括对堆栈进行采样.不幸的是,我无法从文档中得知您是否可以在随机挂钟时间抽取样本,或者在您按下组合键时手动抽取样本.

This link talks about how to gather trace data on an iPhone app, and that includes sampling the stack. Unfortunately, I could not tell from the doc if you can have samples drawn at random wall-clock times, or manually when you hit a key combination.

当你有跟踪时,你可以得到一个调用树,这应该为你提供行级信息.事实上,一行负责的时间百分比是一个简单的数字,即包含该行的堆栈跟踪的分数.问题是,用户界面可能不会向您显示.这是一个有用的统计数据并不为人所知.

When you have traces, you can get a call tree, and that should get you line-level information. In fact the percent of time a line is responsible for is a simple number, the fraction of stack traces containing the line. The problem is, the UI may not show you that. The fact that that is a useful statistic is not well known.

这篇关于iPhone 的线路电平分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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