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.
问题:
回答1:
CodeXL has now superseded the End Of Line\'d AMD Code Analyst and both are free, but not as advanced as VTune. There\'s also Sleepy, which is very simple, but does the job in many cases.
回答2:
Very Sleepy is a C/C++ CPU profiler for Windows systems (free).
CppCheck is a static C/C++ CPU profiler for Windows systems (free).
回答3:
Proffy is quite cool: http://pauldoo.com/proffy/
Disclaimer: I wrote this.
回答4:
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 additions to your code and is able of displaying function statistics with callers and callees in real-time without the need of closing application/stopping the profiling process.
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.
This tool is useful when statistical approximation from sampling profilers like Very Sleepy isn\'t sufficient.
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:
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());
}
回答5:
Microsoft has the Windows Performance Toolkit.
It does require Windows Vista, Windows Server 2008, or Windows 7.
回答6:
A new addition is Shiny.
回答7:
I highly recommend Windows Performance Toolkit (WPT) or XPERF
The command line xperf command line tool records Event Tracing for Windows (ETW) logs that can be analyzed using the GUI xperfview tool.
Using stacktrace command line arguement has 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.
On Windows 8 the Windows Performance Analyzer takes xperf to an even higher level.
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.
If you have never used xperf...you do not know what you are missing
回答8:
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)
回答9:
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.
http://ravenspoint.wordpress.com/2010/06/16/timing/
Requires the Boost library.
回答10:
I used Luke Stackwalker and it did the job for my Visual Studio project.
Other interesting projects are:
- Proffy
- Dyninst
回答11:
I\'ve used \"TrueTime - part of Compuware\'s DevPartner suite for years. There\'s a [free version](you could try Compuware DevPartner Performance Analysis Community Edition.) available.
回答12:
I use VSPerfMon which is the StandAlone Visual Studio Profiler. I wrote a GUI tool to help me run it and look at the results.
http://code.google.com/p/vsptree/
回答13:
You can use EmbeddedProfiler, it\'s free for both Linux and Windwos.
The profiler is intrusive (by functionality) but it doens\'t require any code modifications. Just add a specific compiler flag (-finstrument-functios for gcc/MinGW or /GH for MSVC) and link the profiler\'s library. It can provide you a full call tree or just a funciton list. It has it\'s own analyzer GUI.