C++ 02 Apr 2010 19:11:11
C++ Set Performance
(newer version from 2012-02-20, older std::map benchmarks for GNU g++ 4.3.2 and MSVC++ 2010 beta 2)
A performance comparison of the speed of operations on the various set implementations used in C++. There are 16383 unique elements across which 1000000 insert, lookup, iterate, and erase operations are performed.
And this time I’ve left the raw tick numbers and enabled table sorting so you can compare for yourself. Just be aware that the Linux and Windows numbers cannot be compared against each other.
Sources
- Containers: std::set, std::unordered_set, boost::unordered_set, sorted_vector, sorted_deque
- Ticks counted via cycle.h (local mirror)
- Source: speed-set-int.cpp and speed-set-string.cpp
