适用于 Windows 的最佳免费 C++ 分析器是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/67554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 12:36:51  来源:igfitidea点击:

What's the best free C++ profiler for Windows?

c++windowsprofile

提问by ugasoft

I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free either.

我正在寻找分析器以找到我的 C++ 代码中的瓶颈。我想找到一个免费的、非侵入性的、好的分析工具。我是一名游戏开发者,我在 Xbox 360 上使用 PIX 并发现它非常好,但它不是免费的。我知道英特尔VTune,但它也不是免费的。

采纳答案by yrp

CodeXLhas now superseded the End Of Line'd AMD Code Analystand both are free, but not as advanced as VTune. There's also Sleepy, which is very simple, but does the job in many cases.

CodeXL现在已经取代了 End Of Line 的AMD Code Analyst,两者都是免费的,但不如 VTune 先进。还有Sleepy,它非常简单,但在很多情况下都能完成。

回答by lsalamon

Very Sleepyis a C/C++ CPU profiler for Windows systems (free).
CppCheckis a static C/C++ CPU profiler for Windows systems (free).

Very Sleepy是用于 Windows 系统的 C/C++ CPU 分析器(免费)。
CppCheck是一个用于 Windows 系统的静态 C/C++ CPU 分析器(免费)。

回答by pauldoo

Proffy is quite cool: http://pauldoo.com/proffy/

Proffy 很酷:http://pauldoo.com/proffy/

Disclaimer: I wrote this.

免责声明:我写了这个。

回答by Arty

There is an instrumenting (function-accurate) profiler for MS VC 7.1 and higher called MicroProfiler. You can get it here (x64)or here (x86). It doesn't require any modifications or additionsto your code and is able of displaying function statistics with callers and callees in real-timewithout the need of closing application/stopping the profiling process.

有一个用于 MS VC 7.1 及更高版本的检测(功能准确)分析器,称为 MicroProfiler。您可以在此处 (x64)此处 (x86)获得它。它不需要对您的代码进行任何修改或添加,并且能够实时显示调用者和被调用者的函数统计信息,而无需关闭应用程序/停止分析过程。

It integrates with VisualStudio, so you can easily enable/disable profiling for a project. It is also possible to install it on the clean machine, it only needs the symbol information be located along with the executable being profiled.

它与 VisualStudio 集成,因此您可以轻松启用/禁用项目的分析。也可以将它安装在干净的机器上,它只需要将符号信息与被分析的可执行文件一起定位。

This tool is useful when statistical approximation from sampling profilers like Very Sleepy isn't sufficient.

当来自像 Very Sleepy 这样的采样分析器的统计近似值不够时,此工具很有用。

Rough comparison shows, that it beats AQTime (when it is invoked in instrumenting, function-level run). The following program (full optimization, inlining disabled) runs three times faster with micro-profiler displaying results in real-time, than with AQTime simply collecting stats:

粗略的比较表明,它击败了 AQTime(当它在检测、函数级运行中被调用时)。下面的程序(完全优化,禁用内联)与使用 AQTime 简单收集统计数据相比,使用微型分析器实时显示结果的运行速度要快三倍:

void f()
{
    srand(time(0));

    vector<double> v(300000);

    generate_n(v.begin(), v.size(), &random);
    sort(v.begin(), v.end());
    sort(v.rbegin(), v.rend());
    sort(v.begin(), v.end());
    sort(v.rbegin(), v.rend());
}

回答by epotter

Microsoft has the Windows Performance Toolkit.

Microsoft 有Windows 性能工具包

It does require Windows Vista, Windows Server 2008, or Windows 7.

它确实需要 Windows Vista、Windows Server 2008或 Windows 7。

回答by Buggieboy

A new addition is Shiny.

新增功能是Shiny

?????

?????

回答by MW_dev

I highly recommend Windows Performance Toolkit (WPT)or XPERF

我强烈推荐Windows Performance Toolkit (WPT)XPERF

The command line xperf command line tool records Event Tracing for Windows (ETW) logs that can be analyzed using the GUI xperfview tool.

命令行 xperf 命令行工具记录 Windows 事件跟踪 (ETW) 日志,可以使用 GUI xperfview 工具进行分析。

Using stacktrace command line arguementhas proven to be an invaluable tool for my company as it profiles and troubleshoots bottlenecks. One of the most compelling things is that the WPT can be installed in any environment even on the venerable Windows XP.

事实证明,使用stacktrace 命令行争论对我的公司来说是一个非常宝贵的工具,因为它可以分析和解决瓶颈问题。最引人注目的事情之一是 WPT 可以安装在任何环境中,即使是在古老的Windows XP 上

On Windows 8 the Windows Performance Analyzertakes xperf to an even higher level.

Windows 8 上,Windows 性能分析器将 xperf 提升到更高的水平。

The hard numbers and stats provided in ETW logs are unparalleled in detail except for visual studio profiler (2010/2012) which is also great but not free AFAIK.

除了visual studio profiler(2010/2012)也很棒但不是免费的AFAIK之外,ETW日志中提供的硬数字和统计数据在细节上是无与伦比的。

If you have never used xperf...you do not know what you are missing

如果您从未使用过 xperf ......您不知道您错过了什么

回答by dudico

I use AQTime, it is one of the best profiling tools I've ever used. It isn't free but you can get a 30 day trial, so if you plan on a optimizing and profiling only one project and 30 days are enough for you then I would recommend using this application. (http://www.automatedqa.com/downloads/aqtime/index.asp)

我使用 AQTime,它是我用过的最好的分析工具之一。它不是免费的,但您可以获得 30 天的试用期,因此如果您计划仅优化和分析一个项目并且 30 天对您来说足够了,那么我建议您使用此应用程序。( http://www.automatedqa.com/downloads/aqtime/index.asp)

回答by ravenspoint

Please try my profiler, called cRunWatch. It is just two files, so it is easy to integrate with your projects, and requires adding exactly one line to instrument a piece of code.

请试试我的分析器,叫做 cRunWatch。它只有两个文件,因此很容易与您的项目集成,并且只需要添加一行即可检测一段代码。

http://ravenspoint.wordpress.com/2010/06/16/timing/

http://ravenspoint.wordpress.com/2010/06/16/timing/

Requires the Boost library.

需要 Boost 库。

回答by INS

I used Luke Stackwalkerand it did the job for my Visual Studio project.

我使用了Luke Stackwalker,它为我的 Visual Studio 项目完成了这项工作。

Other interesting projects are:

其他有趣的项目是: