Archived

This topic is now archived and is closed to further replies.

reillyhead

FYI - Debug and Retail runtimes

Recommended Posts

Hi all, Today i put my prog onto my sisters computer to do some testing on a lower end machine. Strangely enough though it ran twice as fast as on mine. A cup of tea later i realized that it was due to my comp using the debug runtime. After I changed my setup from debug to retail, i went from running at 40fps to over 200fps. 5x faster!! I knew that the debug runtime would have some sort of affect, but not that much. So if your performance is way off what you expect, try switching to the retail runtime and seeing what the difference is. I would be interested to see if anyone else experiences such a massive discrepancy. later Marc

Share this post


Link to post
Share on other sites
quote:
Original post by reillyhead

I knew that the debug runtime would have some sort of affect, but not that much.



Translates to: I wasn''t surprised that a discrepancy existed, but i was surprised by the magnitude of it.

I also posted because Ive seen a few... "my engine is only running 30 fps on my p4 with blah blah..."

later
Marc

Share this post


Link to post
Share on other sites
Debug has NO optimizations and a lot of extra data. Each line of C/C++ is translated LITERALLY into a block of assembly. Retail has lots of optimizations like reordering instructions and keeping values in memory

For example:
x += y;
x++;

Debug
mov eax, [x] //Get variables again
mov ebx, [y]
add eax, ebx
mov [x], eax
mov eax, [x] //Get X again
inc eax
mov [x], eax

Retail
add eax, ebx //assumes Variables already in registers
inc eax //Already in eax

As you can see there is a LOT of unneeded code in Debug. Since each line is translated literally and memory is always updated after each line it is a lot easier to debug

Basically debug is for debugging only. I always use retail mode unless it crashes

Share this post


Link to post
Share on other sites
quote:
Original post by Cybertron
Basically debug is for debugging only. I always use retail mode unless it crashes

you should only use retail when you know debug works...

Share this post


Link to post
Share on other sites
Arg, I found this thread interesting so I switched and built in release mode to see the difference. And now I can't get it back to debug mode (debug option is no longer on configurations settings)

Can anyone help me with this? MSVC++ 6.0. I seem to have to create a whole new directory to redo it all and I don't want to.

thanx

ps: you guys are talking about "retail" mode- I thought that's the same as release mode? But if the OP just transfers the .exe to his sisters computer, how does anything change? I think I'm missing something.....

[edited by - Cat_B on March 18, 2003 9:48:17 PM]

Share this post


Link to post
Share on other sites
@Cybertron: thanks, that makes sense.

@Cat_B: using the retail version of directx is different to compiling the program in release mode.
To use the retail version, open the control panel and dbl clikc the directx icon. u can figure it out from there.
As to why you cant revert to debug, umm....

Share this post


Link to post
Share on other sites
quote:
Original post by Cybertron
Why? If it crashes then I switch to debug

because there may be bugs that retail doesn't see that in future are masked by something else so that even debug doesn't see them anymore.

that's assuming you eventually run debug runtime. if you never do, you can have all kinds of bugs around and think that your code is bug-free.

[edited by - niyaw on March 19, 2003 9:25:33 AM]

Share this post


Link to post
Share on other sites