仪器中的红线 [英] Red line in Instruments

查看:93
本文介绍了仪器中的红线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用objective-c编程并在Instruments中测试我的应用程序。我上传了截图。我不明白我的代码上的红线有什么问题?你可以帮我吗?谢谢。

I'm programming on objective-c and testing my application in Instruments. I uploaded screenshots below. I don't understand red line on my code and what's wrong? Can you help me? Thanks.

推荐答案

82.2%可能代表当你的时间检测到的执行时间。程序是在统计分析器下执行的。 IDE会更改行上的颜色,以引起您对程序中最大CPU使用量的注意。

The 82.2% probably represents the amount of execution time that was detected when your program was executed under a statistical profiler. The IDE changes colors on lines to draw your attention to the ones that represent the largest CPU use in your program.

通常,这些可以帮助您找到热点在你的程序中,代表你的软件可以使用最多的地方。

Often times, these can help you find the "hotspots" in your program that represent the places where your software could use the most improvement.

在这种情况下,它是一个系统提供的API,所以你做不了多少提高功能的速度,但可以改善您使用结果的方式。您是否在程序中多次使用相同的路径数据调用此函数?您可以缓存它返回的 UIImage ,并在每次需要时重新使用已解析的图像,而不是每次都重新读取它。

In this case, it is a system-provided API, so you can't do much to improve the speed of the function, but you can improve how you use the results. Do you call this function with the same path data more than once in your program? You could cache the UIImage that it returns and re-use the parsed image each time you need it rather than re-reading it every time.

如果对显示的每个图像执行一次此函数,从不使用相同的参数调用它两次,那么进一步改进它将非常困难。

If you execute this function once for every image you display, never calling it twice with the same arguments, it would be extremely difficult to improve upon it further.

这篇关于仪器中的红线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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