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.