哪个是最可靠,最快的Windows C ++分析器,你已经使用? [英] Which has been the most reliable, fastest Windows C++ profiler that you have used?

查看:119
本文介绍了哪个是最可靠,最快的Windows C ++分析器,你已经使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Windows上配置一个实时C ++应用程序。大多数可用的剖析器要么是非常昂贵的,总的过度杀伤,或两者。我不需要任何.NET的东西。由于它是一个实时应用程序,我需要分析器尽可能快。这将是非常好的,如果它以某种方式与Visual Studio 2005/2008集成,但这不是必要的。如果这个描述提醒你一个你使用的分析器,我真的想知道它。我希望借鉴人们在Windows上使用C ++ profilers,以确定一个会做这项工作。谢谢。

I need to profile a real time C++ app on Windows. Most of the available profilers are either terribly expensive, total overkill, or both. I don't need any .NET stuff. Since it is a real time app, I need the profiler to be as fast as possible. It would be excellent if it integrated in some way with Visual Studio 2005/2008, but that's not necessary. If this description reminds you of a profiler that you have used, I would really like to know about it. I am hoping to draw from people's use of C++ profilers on Windows to pinpoint one that will do the job. Thanks.

推荐答案

当我要配置实时代码时,我认为唯一的解决方案是手工制作。你不想要太多的覆盖,或者你最终减慢代码,但是使用一个小的数据集,你需要非常专注,基本上用手捡每个点。

When I have to profile realtime code, I think the only solution is something hand-rolled. You don't want too much coverage or you end up slowing the code down, but with a small data set, you need to be very focused, essentially picking each point by hand.

所以我几年前写了一个头文件,它定义了一些宏和一个捕获数据的机制,作为函数定时或时间线(在函数X的时间T )。此代码使用 QueryPerformanceCounter 进行计时,并将通过 CreateFileMapping 将数据存储到命名的共享内存中,以便我可以查看另一个进程的计时数据。

So I wrote a header file several years ago that defines some macros and a mechanism for capturing data, either as function timings or as a timeline (at time T in function X). The code uses QueryPerformanceCounter for the timings and writes the data into named shared memory via CreateFileMapping so that I can look at the timing data from another process live.

它需要重新编译来更改我要捕获的定时信息,但是代码太便宜,对代码没有影响。

It takes a recompile to change what timing information I want to capture, but the code is so inexpensive that It has virtually no effect on the code.

所有代码都在头文件中(使用宏保护,所以代码只包含一次)。所以头文件本身是我的profiler。我更改头中的一些表,然后标记目标代码,重新编译并启动性能分析。

All of the code is in the header file, (with macro guards so the code only gets included once). so the header file itself is my 'profiler'. I change some tables in the header, then and markup the target code, recompile and start profiling.

这篇关于哪个是最可靠,最快的Windows C ++分析器,你已经使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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