Log in

View Full Version : Affordable profiler


Mattias
07-31-2003, 01:24 AM
What performance profiler do you guys use? Professionally, I've been using VTune, but at $700 it is a bit too expensive for my indie ventures. And it would be nice with something a bit better than the built in visual studio one...

LordKronos
07-31-2003, 04:11 AM
I use VTune, myself.

If you have VisualStudio.NET, one that might be worth looking at is this one from NuMega:
http://www.compuware.com/products/devpartner/profiler/default.asp

I've never tried this one myself (still on Visual Studio 6), but it appears to be free (none of the wording on that page makes it sound like a demo). I've worked with some of the other NuMega tools in the past and they were top notch. It seems to me NuMega used to have another profiler that worked under Visual Studio 6. I think maybe it was called True Time, but I can't seem to find it on their site. I think it was only a couple hundred dollars, so it might be worth seeing if it's still available.

mkovacic
07-31-2003, 05:11 AM
Originally posted by Mattias
What performance profiler do you guys use? Professionally, I've been using VTune, but at $700 it is a bit too expensive for my indie ventures. And it would be nice with something a bit better than the built in visual studio one...
AMD CodeAnalyst is not bad and it's free. Check it out.

BrewKnowC
07-31-2003, 05:36 AM
Originally posted by Mattias
And it would be nice with something a bit better than the built in visual studio one...

Visual Studio has a built in profiler?!?!? How do you access it?

aspiral
07-31-2003, 06:17 AM
Originally posted by BrewKnowC
Visual Studio has a built in profiler?!?!? How do you access it?


VC6 go to Build -> Profile -> ...
(it's only there in enterprise edition i think)

tspilman
07-31-2003, 08:19 AM
I also suggest trying Glowcode ( http://www.glowcode.com/ ). Not free, but cheap ar $295.

BrewKnowC
07-31-2003, 06:46 PM
Speaking of profilers (and debuggers), do they only work if your program runs in windowed mode? or will they work for a full screen only game as well? (I don't want to hijack this thread, but this has been something thats been bothering me for a while)
Thanks
Bruno

tspilman
07-31-2003, 06:58 PM
Speaking of profilers (and debuggers), do they only work if your program runs in windowed mode? or will they work for a full screen only game as well?

Every profiler i've worked with ( VTune, Glowcode, TrueTime, VisualStudio's built-in profiler ) would work with a fullscreen app. They just run in the background collecting data to be displayed after your done running the game.

WreckerOne
07-31-2003, 10:20 PM
Heres what I understand about the VS.NET profiler

http://www.compuware.com/products/d...ler/default.asp

Instead of writing a profiler for c++ .NET, Microsoft contracted it out to these guys. These guys made the devpartner profiler, but (at least for me) it crashes after each profile.

As soon as the profiler project was done, that was it. The "community edition" profiler isn't going anywhere and I don't think anyone is working on it. I.E. the contract is up.

BrewKnowC
08-01-2003, 07:41 AM
Originally posted by tspilman
Every profiler i've worked with ( VTune, Glowcode, TrueTime, VisualStudio's built-in profiler ) would work with a fullscreen app. They just run in the background collecting data to be displayed after your done running the game.

Really? When I run the Visual Studio Profiler, my game goes to a black screen then just crashes before it even gets to the title screen. Any ideas?

grieve
08-01-2003, 08:15 AM
If you have some idea of where the bottleneck is in your code, you can write your own profiler (under windows anyway) using the query performance counter. Here is a sample program that uses it.


#include <windows.h>
#include <stdio.h>

typedef unsigned __int64 uint64;


void SlowLoop()
{
Sleep(100);
}


void main()
{
uint64 ticksPerSecond;

uint64 startTick;
uint64 endTick;
long ms = 0; // milliseconds

// You just have to do this once at the beginning of your program
QueryPerformanceFrequency((LARGE_INTEGER *)&ticksPerSecond);

// capture the start tick
QueryPerformanceCounter((LARGE_INTEGER *)&startTick);

// Whatever your measuring goes here.
SlowLoop();

// capture the end tick
QueryPerformanceCounter((LARGE_INTEGER *)&endTick);

ms = (long)((endTick - startTick) / (ticksPerSecond / 1000)); // divide by 1000 to get ticks per millisecond

printf("SlowLoop() took %d milliseconds\n", ms);
}


You could easily wrap the QPC calls into a C++ class to make life easier. The nicest thing about this is that it allows you to profile part of a function if you suspect that it is slow, and if you are not averse to #ifdefs profiling your code is simple a matter of turning on a #define and re-compiling.

Enjoy,
grieve


p.s. Just a general profiling tip from past experience. The easiest way to find a bottleneck in your code with this method is to perform a top down binary search of your code. In other words profile the highest level functions first, and work your way down to the slow as you see which parts are the slowest. While this seems like a lot of work it can save you time in the long run. Its systematic nature forces you to avoid making incorrect assumptions about which code is slow, thus saving you from optimizing code that you thought was slow but really wasn't.

ok I'll stop rambling now.

BrewKnowC
08-01-2003, 08:19 AM
grieve - Thank you very much! I really just needed some way to see how much improvement I was making to the speed of my game. That'll work perfect!
Thanks again,
~Bruno

Mattias
08-03-2003, 11:46 PM
Thank you everyone for all your answers!

I'm going to go with AMD CodeAnalyst. Very easy to use, free, and gets me all the info I need, without the extreme slowdown that visual studios built-in profiler tends to cause.

Many thanks

tspilman
08-04-2003, 03:50 AM
I'm going to go with AMD CodeAnalyst. Very easy to use, free, and gets me all the info I need, without the extreme slowdown that visual studios built-in profiler tends to cause.

On that subject. Does CodeAnalyst run just as well on an Intel system? I'm sure i loose some features, but i can't tell what from AMD's page.

Mattias
08-04-2003, 04:07 AM
Yeah, I'm running it on an Intel, and all I've noticed is that I can't run event-based sampling.