• entries
56
80
• views
41754

# Microsoft's STL implementation slow? - 2

304 views

Thanks everyone, I've received a lot of helpful comments and I was able to solve the problem.

Apparently, regardless of whether you're in release mode or not, Microsoft's vectors do some 'other' stuff in the background.

So, in order to fix this issue you have to use these pre-processor definitions:

#define _CRT_SECURE_NO_WARNINGS#define _SCL_SECURE_NO_WARNINGS#define _SECURE_SCL 0#define _HAS_ITERATOR_DEBUGGING 0

I still think it's a bit silly that they assume you want iterator checking, etc on but w/e.

## 1 Comment

Yeah, I agree. I'd far rather have it controlled by the _DEBUG define. I was under the impression that this is why we have a std::vector<>::at() method as well as an operator[].

It's also a pain if you are writing libs, since I'd assume all the different parts of a solution have to be compiled with the same flags to prevent stuff exploding.

I guess it's to do with Microsoft encouraging more security-robust code.