When using Visual studio setting HAS_ITERATOR_DEBUGGING=0 can lead to quite a large speedup.

However, it is essential to set macro value the same for all projects. I had library and executable that were crashing in Release mode only. The library was compiled with HAS_ITERATOR_DEBUGGING=0 whilst the exe was not. The program would immediately crash. Setting HAS_ITERATOR_DEBUGGING=0 on the exe fixed the problem