I checked performance of c++ project and results are not so clear to me.
std::_lockit::int()
has over 20% of exclusive samples. What does it do and how do I avoid overusing it? I have a lot of things created with std::vector
, so there is a hope that these are connected.
Asked
Active
Viewed 4,081 times
11

Pavel Oganesyan
- 6,774
- 4
- 46
- 84
-
Did you enable all optimizations and disable debugging? – Kerrek SB May 27 '13 at 09:37
-
Yes I use /Ox to build. – Pavel Oganesyan May 27 '13 at 09:43
-
3Well, it's a Microsoft-specific internal thing... might be better to consult the compiler manual. It's nothing to do with standard C++. – Kerrek SB May 27 '13 at 09:44
-
http://us.generation-nt.com/answer/multithreaded-dll-what-going-std-lockit-help-11610292.html#r – vpram86 May 27 '13 at 11:10
1 Answers
10
_Lockit is commonly used in Microsoft's implementation of the STL for debugging iterators. In production environments these can be the cause of significant performance bottlenecks while iterating over containers with a large number of elements.
Debugging iterators can be disabled by defining the macros _HAS_ITERATOR_DEBUGGING
and _SECURE_SCL
as 0
in your code, or Visual Studio project properties.

Community
- 1
- 1

David Cormack
- 326
- 6
- 9