Profiling in Visual C++ Express

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Profiling in Visual C++ Express

Post by Richard Allbert »

Hi,

Until now I have always used Code::blocks as my IDE with GNU c++ as the compiler.

I download MSVC++ Express - and really like it! Especially the feeling when compiling finally with no warnings :). Also, the debugging features are great - first time I realised it was possible for step through the program and see the values of the variables as you go. :shock: 8-)

Question is, is it possible to use a profiler with it? If so which one?

The profiler that comes as a plugin with Code::blocks always "crashes / says there is no debug info", so I never get a result.

The profiler that comes with DevC++ does work, but It's annoying have to switch between IDE's all of the time.

Or is there a better alternative to all of the above :) ? Buying the software seems a bit expensive for my uses...

Thanks!

Richard
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Profiling in Visual C++ Express

Post by Carey »

I don't know about VCExpress 2008.

However, I can tell you that you can't use GNU's, which is what codblocks & devc++ use.

Microsoft goes out of their way to hide profilers, even when they are included (and I don't know if the Express even has it.)

For example, with the VC++ 2005, you can turn on profiling, but to actually get a report you have to use a hidden command line program to do it.

I think Microsoft feels that Real Programers don't profile... They just trust Microsoft. Or some such nonsense.

Anyway, if the Express versions don't have it, the odds are good the platform SDK would have one. But it might be a command line program to get the report rather than being integrated.

You'd have to check further.

I know that's not much help, but it's all I can give and I thought the PSDK was worth mentioning if the Express compilers didn't have anything
included.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Profiling in Visual C++ Express

Post by jdart »

Even the Professional Edition of VC++ 2008 lacks profiling support. It is in the very expensive VC++ Team System (which is, however, available as a trial download or CD).

--Jon
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: Profiling in Visual C++ Express

Post by brianr »

According to MSFT, only a couple of the "Team" editions support profiling. See
http://msdn.microsoft.com/en-us/vs2008/ ... 49003.aspx

I have used profiling with older Visual Studio versions, and never had to resort to the command line.
When looking for a profiling command line alternative for VS2008 some months ago,
I seem to recall that there is a specific run time .dll that is needed that MSFT does not include
(not in the SDK either that I could find, or download anywhere).

Better news is that the SDK does make it quite easy to support 64 bit C/C++
(again, command line not needed).
Unfortunately, 64 bit assembler support was dropped (some time back?),
but it can be supported via a separate .obj files (called functions) and not directly inlined
(unless using the few cumbersome 64 bit intrinsics).
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: Profiling in Visual C++ Express

Post by Richard Allbert »

Ok, thanks for the help.

It's a shame MS don't offer it, and a little odd.

Richard
trojanfoe

Re: Profiling in Visual C++ Express

Post by trojanfoe »

jdart wrote:Even the Professional Edition of VC++ 2008 lacks profiling support. It is in the very expensive VC++ Team System (which is, however, available as a trial download or CD).

--Jon
That isn't true. I have the x64 professional edition and there is a profiling option within the GUI under Build > Profile Guided Optimisation, and there are also the pgomgr.exe (and friends) command line utilities.

Cheers,
Andy
Tony

Re: Profiling in Visual C++ Express

Post by Tony »

Richard Allbert wrote:Hi,

Until now I have always used Code::blocks as my IDE with GNU c++ as the compiler.

I download MSVC++ Express - and really like it! Especially the feeling when compiling finally with no warnings :). Also, the debugging features are great - first time I realised it was possible for step through the program and see the values of the variables as you go. :shock: 8-)

Question is, is it possible to use a profiler with it? If so which one?

The profiler that comes as a plugin with Code::blocks always "crashes / says there is no debug info", so I never get a result.

The profiler that comes with DevC++ does work, but It's annoying have to switch between IDE's all of the time.

Or is there a better alternative to all of the above :) ? Buying the software seems a bit expensive for my uses...

Thanks!

Richard
I remember the profiler in VS2003 to be very very slow. (engine slowdown of > x5, even when profiling sampling based)

AMD's code Analyst however integrates nicely in visual studio, and works pretty well and fast.

Tony
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Profiling in Visual C++ Express

Post by jdart »

I was not referring to PGO (which uses the results of a profiling run to tune code generation) but to a code profiling tool (which produces a human-readable report of where a program is spending its time).

--Jon
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Profiling in Visual C++ Express

Post by Carey »

jdart wrote:I was not referring to PGO (which uses the results of a profiling run to tune code generation) but to a code profiling tool (which produces a human-readable report of where a program is spending its time).

--Jon
In the process of doing a PGO, it'll do a profiling that you can dump to get the desired information. You may or may not have to use a command line tool to get that dumped information.

As I said, Microsoft goes out of their way to hide it, even when its included.

I've never heard a good explanation why, but the consensus is that Microsoft just doesn't want us to profile the code. That we should be happy with their product...


But again, that may or may not even exist in the VCExpress stuff. If Microsoft doesn't want the professionals profiling the code, then there's not much chance they want the hobbiests profiling the code!

Even the PSDK might not have it. I don't know. You'll have to check.

If not, then you are out of luck.

Carey
trojanfoe

Re: Profiling in Visual C++ Express

Post by trojanfoe »

Yes the pgomgr.exe command line utility is used to generate the "report" of the program run.

http://msdn.microsoft.com/en-us/library/2kw46d8w.aspx

There might be more mileage in the Intel VTune suite, but that costs yet more money and the evaluation version seems to screw up my VS2008 installation.

Cheers,
Andy