Why is _mainCRTStartup so slow with debugging on, but fast with debugging off?
I'm using 32-bit GLUT on 64-bit Windows 7 with Visual Studio 2010. The project just contains my C++ implementation and header files. No Win32-specific code.
I do a lot of pixel drawing operations. It's instantaneous with the release configuration, but very slow (at least 5 seconds until it draws) with the debug configuration. I noticed it slowed down more when I drew more. So I figured, pro开发者_Python百科file it.
The Visual C++ profiler says 100% (I'm guessing that's rounded up) of the time is spent in _mainCRTStartup
. I understand this is the C run time, but what's causing it to run so slowly in the debug configuration? The equivalent C code is equally instantaneous when in both debug and release configurations. Is there anything special with C++ that makes _mainCRTStartup
take much longer?
EDIT: Apparently I overlooked one thing: under _mainCRTStartup frame, there is a reference to Unknown frame(s)
. I assume this is the main()
and its children functions. I cannot get it to actually profile the functions I wrote, either in debug or release. Where do I go after this?
The debugger is probably having trouble finding the .pdb files for the DLLs that you use. First thing to do is to check your symbol server settings. Tools + Options, Debugging, Symbols. Uncheck the Symbol file locations and try again.
What the "exclusive % samples" in _mainCRTStartup
? Inclusive samples are worthless for this routine.
_mainCRTStartup
is the primary function that calls main
. So yes, for every program, 100% of the time is spent inside that function- because it calls all other functions.
You're profiling Debug mode? Just why?
精彩评论