🔒 Locked
Difference between Debug and Release code...
Advertisement
Original Post
Hi Gamedev, Earlier, there was a thread that discussed the difference between running in debug and release mode. From what I understood from the thread, it's expected that running in release mode would be much faster than running in debug mode. But I'm experiencing the opposite. My code compiled in debug mode is running much faster than the one compiled in release mode. Would you know what could be causing this? Thanks.
Quote:
Original post by seejenn
Hi Gamedev,
Earlier, there was a thread that discussed the difference between running in debug and release mode. From what I understood from the thread, it's expected that running in release mode would be much faster than running in debug mode. But I'm experiencing the opposite. My code compiled in debug mode is running much faster than the one compiled in release mode. Would you know what could be causing this?
Thanks.
One quick thing to remember for debug vs release.
In release mode all asserts are dropped, which means the followign code will work in debug but not releae:
assert(pointer++)
There is a way around this, a simple way i just dont remember..
All my code does is retrieve data from the database and format everything into an output flat file. I can't post the code here as I'll be breaking company policy but it's just a simple retrieve-format-output process. I'm not sure why it's running longer in release mode than in debug mode. i'm not even sure if i have to rewrite the whole thing. That sucks.
Quote:
In release mode all asserts are dropped, which means the followign code will work in debug but not releae:
assert(pointer++)
There is a way around this, a simple way i just dont remember..
I'd say the easiest way around it is to not write asserts that affect the code:
assert(pointer);
pointer++;
Quote:
Original post by EonStrife
xErix, thanks. But, I think that VC++ won't compile (or generate error messages) if I use uninitialized variables...Hence, I won't be able to run the program in debug mode if I do that...
It may generate a warning if it can tell, which is a big "if". You may also need to crank up the warning settings to get it to display, I don't remember VC's default behavior on this off the top of my head. Try it anyways, it might uncover the problem ;-).
Uninitialized variable....Like this one ?
int i;
Then I should do this ?
int i=0;
??
BTW, a little OT. Seems that I have hidden breakpoints in my program (I use VC++ 6.0). Sometimes, the program breaks and VC++ gives message like "User Breakpoint at xxxxxxxx), and I am presented with assembly code. How do I clear those hidden breakpoints (Even though the breakpoint list in Edit->Breakpoints is empty) ?
int i;
Then I should do this ?
int i=0;
??
BTW, a little OT. Seems that I have hidden breakpoints in my program (I use VC++ 6.0). Sometimes, the program breaks and VC++ gives message like "User Breakpoint at xxxxxxxx), and I am presented with assembly code. How do I clear those hidden breakpoints (Even though the breakpoint list in Edit->Breakpoints is empty) ?
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement