Skip to main content
gamedev.net
🔒 Locked

Optimization help...

Started by TheQ 1 reply 400+ views
Original Post
TheQ
TheQ
I'm currently trying to optimize some code however what would be very usefull is some sort of program that would give me statistics on my code, which functions are getting more cycles, which are using more time, memory, maybe (even though I'ts clean) memory loss. I used to use one on the PS2 (I can't remember what it was) - thanks! Does VC alreay give me this tool? -Q
tomek_zielinski
tomek_zielinski
VC gives you a tool to deteck memory leaks

just put this:

#define CRTDBG_MAP_ALLOC // Microsfotwoy leak detector
#include <crtdbg.h>

and then

_CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF );


at the beginning of you WinMain() function


You can profile your code using time functions lik timeGetToime, GetTickCout but it won't be accurate.

Better choice wuold be QueryPerformanceCounter/Frequency

but some guys've had problems with it.

The best would be to use low level timer. There is an article somewhere about it, I read it a few moths ago, but I cannot remebmer now what was the title.
www.tmreality.com
Skizz
Skizz
MSVC does provide function time profiling as well as function and line coverage.

Skizz

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.