Page 1 of 1

Debug Speed VS Release Speed

Posted: Thu Dec 02, 2010 21:56
by tedlin01
Hello!
I noticed that it's a huge difference in CEGUI speed in debugmode vs releasemode using Visual Studio 2008. Loading the content for CEGUI in debug takes 60 seconds vs 5 seconds in release. Also there is several other features I cant run in debugmode since it's such a huge difference in speed, (resizing for example). Is there some how I can run the releasedlls in debug-mode or some other way I can make CEGUI run alot faster while running debug in visual studio?

Re: Debug Speed VS Release Speed

Posted: Thu Dec 02, 2010 23:42
by Jamarr
You should probably build CEGUI in release, with non-optimized code and debug symbols turned on. CE may have added a build option for this (ReleaseWithSymbols?) in later versions.

Re: Debug Speed VS Release Speed

Posted: Fri Dec 03, 2010 19:06
by cCj
Hi

you could goto the project settings -> Linker -> Input , and change the CEGUIs lib files from debug to release.

the debug are called CEGUIBase_d.lib
CEGUIOpenGLRenderer_d.lib etc

and Release is without the _d :

CEGUIBase.lib
CEGUIOpenGLRenderer.lib
etc

Re: Debug Speed VS Release Speed

Posted: Fri Dec 03, 2010 20:37
by Jamarr
cCj wrote:Hi

you could goto the project settings -> Linker -> Input , and change the CEGUIs lib files from debug to release.

the debug are called CEGUIBase_d.lib
CEGUIOpenGLRenderer_d.lib etc

and Release is without the _d :

CEGUIBase.lib
CEGUIOpenGLRenderer.lib
etc


Assuming he is building a debug version of his own project and using the debug-version of the MSVC runtime, there have been numerous issues attempting to use this release version of the MSVC runtimes with this configuration in the past. This may cause inexplicable errors (crashes in random parts of the code) since objects can/are of different sizes and/or alignments between debug and release versions of the runtime. If he is using the release versions of the MSVC runtime in his own project, then this approach could work out for him.

Re: Debug Speed VS Release Speed

Posted: Sat Dec 04, 2010 19:59
by tedlin01
Just by using the the release libs I get a crash when starting the program,

ErrorMessage:
Unhandled exception at 0x00884eae in CauseOfWar.exe: 0xC0000005: Access violation reading location 0x0025f9f7.

The debugger points to this code:
"_RELIABILITY_CONTRACT
void __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)
{ /* lock mutex */
#ifdef _M_CEE
System::Threading::Thread::BeginThreadAffinity();
#endif
EnterCriticalSection(_Mtx);
}
"

EDIT:
SetMouseCursor triggers this error but if I comment it out I get another error :/

Re: Debug Speed VS Release Speed

Posted: Sun Dec 05, 2010 17:42
by cCj
I forgot that you need to change the build type from "Multi-threaded Debug DLL" to "Multi-threaded DLL"..

when u do that debugging capilities maybe effected though.

Re: Debug Speed VS Release Speed

Posted: Sun Dec 05, 2010 20:41
by tedlin01
hm.. it works if i change from _DEBUG to NDEBUG to compile but then I cant trace crashes :P