Skip to main content
GameDev.net gamedev.net
🔒 Locked

[MFC] debug/release performance

Started by imortales Jan 31, 2006 at 10:09 PM 2 replies 300+ views
Original Post
imortales
imortales
Hi! I've made a terrain rendering engine using MFC & OpenGL and i've got an odd problem. The release version is working slower than the debug version. I get pathetic 20 FPS in the release mode while the debug version manages 35 - 40 FPS with the same load. Any ideas what I might be doing wrong?
Spoonbender
Spoonbender
Yep. You forgot to profile and debug your app.
You also forgot to post relevant parts of the code, or any kind of detail about your project. [wink]

These things combined mean that no one, not you, and certainly not anyone else at GD.Net can pinpoint the problem.
BeanDog
BeanDog
Well, I don't know if it's at all related, but I spent a few hours last night trying to figure out why my release mode seemed several times slower than my debug mode of my game. As it turns out, my message loop was being done wrong. I was doing this:
while( msg.message!=WM_QUIT ){	if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )	{		TranslateMessage( &msg );		DispatchMessage( &msg );	}	else if(GetFocus() == m_hWnd)	{		//Do my game logic, render, and so forth.	}}

This was very very bad. The solution is this:
while( msg.message!=WM_QUIT ){	if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )	{		TranslateMessage( &msg );		DispatchMessage( &msg );	}		if(GetFocus() == m_hWnd)	{		//Do my game logic, render, and so forth.	}}

My old code was making it so that every time I got a message from Windows, my game logic would not get executed. So every time I pressed (or held down) a key, or moved the mouse, the game would seem to lock up. It took me forever to track this one down.

Again, not sure if this is your problem at all, but it's got a similar symptom.
imortales
imortales
I didn't post any code because it is the same for both versions, and I assumed it was a compiling problem. But now I've tried the release version on another computer and it works just fine on it. On my own machine, however, it is running considerably slower.
Oh, some details: the program is displaying a triangle mesh with a very large texture(which causes the low performance).

Topic Locked

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

Sign in to reply to this topic.