如何分析单点触控应用程序?

发布于 2024-12-04 16:20:54 字数 467 浏览 0 评论 0原文

我正在尝试使用 Instruments 分析我的 iPhone 应用程序中的性能问题。我在调试模式下编译并安装了我的应用程序,创建了一个“时间分析器”并成功记录了相关时间间隔的一些数据,但我还没有弄清楚如何分析我正在记录的数据。

我了解探查器通常是如何工作的,我对 Rational Quantify 有相当多的经验,但在这种情况下我被难住了。

我想看到的内容:我编写的哪些函数是给定时间段内的 cpu 性能瓶颈?

我所看到的:许多看似微不足道的噪音显然与我自己的应用程序代码无关:http://screencast.com/t/3gYOuwua3

我尝试过各种过滤器,但没有一个真正有帮助。我应该如何进行?

谢谢,

阿德里安

I am trying to analyze a performance issue in my iPhone app with Instruments. I compiled and installed my app in debug mode, created a "Time Profiler" and successfully recorded some data of the time interval in question, but I haven't figured out how to analyze the data I am recording.

I understand how a profiler usually works, I have quite a bit of experience with Rational Quantify, but in this case I am stumped.

What I would like to see: Which of the functions I coded are the cpu performance bottlenecks during the given time period?

What I do see: Lots of seemingly insignficant noise apparently with no relation to my own application's code whatsoever: http://screencast.com/t/3gYOuwua3

I've tried all kinds of filters, but none really helped. How should I proceed?

Thanks,

Adrian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

浮云落日 2024-12-11 16:20:54

这很常见......

首先,“自我”时间在任何真正的软件中几乎毫无用处。
它所做的只是让你看着它然后“嘎嘎!”。

如果你碰巧在某个时间点冻结​​它,你会看到一个调用堆栈有很多层,并且在堆栈的顶端,它要么被

  • 阻塞在 I/O、睡眠或其他一些非计算状态,要么
  • 通过一些远离代码的库层运行程序计数器。

在您可以控制的代码中很少找到程序计数器。
因此,即使您确实在代码中找到了超过百分之几的自我时间,修复它也无法节省更多的时间。

另一方面,堆栈上的其他代码行又如何呢?
如果你冻结它 10 次,其中有 5 次,某一行特定的代码在堆栈上,你就知道该行,如果你可以避免执行它,大约可以为你节省 50% 。

我不寻找“慢功能”或“热点”。
我使用的技术是这个,还有一个还有更多原因

This is so common...

First of all, "Self" time is nearly useless in any real software.
All it does is make you look at it and go "gack!".

If you happened to freeze it at a point in time, you would see a call stack many layers deep, and at the tip of the stack it would either be

  • blocked in I/O, sleep, or some other non-computing state, or
  • running the program counter through some library layers far removed from your code.

It is seldom to find the program counter in code you have any control over.
So even if you did locate more than a few percent of self time in your code, fixing it can't conceivably save any more than that.

On the other hand, what about the other lines of code on the stack?
If you froze it 10 times, and on 5 of those times, a particular line of code was on the stack, you know that line, if you could avoid executing it, would save you 50%, roughly.

I don't look for "slow functions" or "hot spots".
The technique I use is this, and there are a lot more reasons why.

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