如何在iPhone应用程序中找到性能瓶颈? [英] How to find performance bottlenecks in an iPhone app?

查看:133
本文介绍了如何在iPhone应用程序中找到性能瓶颈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我的应用程式的效能不佳,想要找出代码中的哪些部分是邪恶的。

I feel my app has bad performance, and want to figure out which parts in code are evil. Is there a good tutorial somewhere on how to find these?

推荐答案

仪器在这方面是你的朋友,并且有许多优秀的性能分析用于查找内存泄漏的工具,您使用的内存量,详细跟踪哪些代码正在运行等等。您可以在此处找到仪器用户指南 a>。

Instruments is your friend in this regard, and has many excellent profiling tools for finding memory leaks, how much memory you're using, detailed tracing of what code is running when, and so on. You can find the Instruments User Guide here.

但是,您还应该查看一个名为Shark的小工具,随开发工具一起安装。就个人而言,我发现Shark比仪器更有用,用于分析我的代码,并找出什么是需要时间,当它是重要的。请阅读使用Shark 4优化应用,了解有关使用Shark的大量信息。

However, you should also look into a little tool called Shark, installed with the developer tools. Personally, I find Shark more useful than Instruments for profiling my code and finding out what's taking up time when it matters. Read Optimizing your Application with Shark 4 for lots of great info on using Shark.

我刚刚花了几天优化我的iPhone应用程序,而Shark是一个了不起的工具。一旦你找到了你慢的地方,使它快,可能是相当困难的,尤其是如果你绘制UIImages - 期望做大量的图像缓存到静态变量!

I've just spent a few days optimising my iPhone app, and Shark is a wonderful tool. Once you find out where you're slow, making it fast can be quite difficult, especially if you're drawing UIImages — expect to do a lot of caching of images into static variables!

优化可以真正降低代码的可读性,因此请确保您在那里做的很仔细,这是绝对必要的。

Optimising can really reduce the readability of your code, so make sure you're careful where you do it and that it's absolutely necessary.

这篇关于如何在iPhone应用程序中找到性能瓶颈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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