Why iterators cause very slow debugging in VS2010, even if _HAS_ITERATOR_DEBUGGING, _SECURE_SCL, _SECURE_SCL_THROWS is set to 0

I’m trying to track why it takes so long to debug our program in debug mode. After using xperf to see what the stacks looked like, it was obvious that we spent a lot of time on the iterator and STL containers. For a while I searched this page and found options

_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
_SECURE_SCL_THROWS=0

And I installed everything from the code in #define

#define _HAS_ITERATOR_DEBUGGING 0
#define _SECURE_SCL 0
#define _SECURE_SCL_THROWS 0

But that didn't work, so I tried it using preprocessor definitions inside the visual studio project, but it still didn't help.

, , , , , , . , 140 . 2400 . 17-18 .

, , ++ dll, #.net 4, . DLL . ++.

.

/I"..\CommonInclude" /Zi /nologo /W4 /WX /Od /Oy- /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "ENGINE_EXPORTS" /D "_HAS_ITERATOR_DEBUGGING=0" /D "_SECURE_SCL=0" /D "_SECURE_SCL_THROWS=0" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /D "_MBCS" /Gm- /EHa /MDd /GS /fp:precise /Zc:wchar_t- /Zc:forScope /GR /Yu"StdAfx.h" /Fp".\Debug/Foo.pch" /Fa".\Debug/" /Fo".\Debug/" /Fd".\Debug/" /Gd /analyze- /errorReport:queue /EHa -Zm350 /MP3 

, , ?

+5
3

:

, . xperf, , , , STL.

node (, map, set, unordered_map, unordered_set, multimap, multiset, list ..) , , . Windows, . node , .

- , "" : _NO_DEBUG_HEAP=1

.

+7

, , , . .

, 100+, .

+1

, :

  • , AMD CodeAnalyst, - , , , Xperf. , , .
  • Create a release build with optimizations disabled (for this you can create a separate configuration). This will disable iterator debugging (in case this is causing a slowdown), but can provide much more useful debugging information than the original version. Make sure the "Drop frames" option is enabled.
+1
source

All Articles