分析代码以提高效率? [英] Analyzing Code for Efficiency?

查看:29
本文介绍了分析代码以提高效率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您使用哪些工具来确定代码的效率?您是否使用运行大量测试的本土应用程序或某些商业产品?您是否使用自己的知识来测试代码的某些区域,或者使用一些工具来分析代码的弱点?

What kinds of tools do you use to determine the efficiency of code? Do you use home grown applications that run a statistically significant number of tests, or some commercial product? Do you use your own knowledge to test certain areas of your code, or some tool that analyzes your code for weak spots?

推荐答案

这叫做 profiling.对于各种不同的语言,有许多现成的工具可以帮助您确定应用程序中的瓶颈在哪里.例如,用于 Java 的 TPTP 工具集可以向您展示性能瓶颈所在的各个方法水平,如果你愿意的话.当然,有时您真正需要的只是对系统计时器进行几次读取,以大致了解一段代码.

This is called profiling. There are lots of off-the-shelf tools available to help you determine where the bottlenecks in your applications are, for all kinds of different languages. For example, the TPTP set of tools for Java can show you where performance bottlenecks are down to the individual method level, if you want it to. Of course, sometimes all you really need is a couple of reads of the system timer to get a general idea about a section of code.

这篇关于分析代码以提高效率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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