STL Debug Lib performance

STL Debug Lib performance

Post by TmljayBQb3 » Fri, 02 Dec 2005 02:16:02

Are there compile time, run time, or link time options to control the
performance of STL in a debug build?

I am finding that the basic containers are so slow in my application in a
debug build that I can't actually use the program I am working on.

In a release build, push_back on a vector is plenty fast; in the debug
build, it is very much slower. (Yes, I know how to use resize, etc. This is a
large codebase of which I am working on a small portion, and waiting for
everyone else's code to grind through millions of Heap Checks or whatever is
eating too much of my day in debug builds).


STL Debug Lib performance

Post by P.J. Plaug » Fri, 02 Dec 2005 02:47:11

Sounds like you're maintaining a heap in a vector. The iterator debugging in
V8 (.NET 2005) checks heap integrity on every heap operation, which is
great when you're hunting down a bug in an ordering predicate but which
really eats time. Microsoft has added machinery for disabling order checks,
while leaving the other iterator debugging logic intact. Look at the header
xutility and the use of macros _DEBUG_ORDER_IMPL and
_DEBUG_ORDER_SINGLE_IMPL. If you predefine either of these macros,
you can change the function actually called to do the check.


P.J. Plauger
Dinkumware, Ltd.


STL Debug Lib performance

Post by TmljayBQb3 » Fri, 02 Dec 2005 03:17:27

Thanks! That's exactly what I was looking for :-)