Some time ago I discovered a performance bug in MingW's implementation of iter_swap (which is used to swap items by the sorting routine among others). If you happen to have this compiler and change the implementation to:
Code:
//fixed implementation (must be moved after swap in stl_algobase.h)
template<typename _ForwardIterator1, typename _ForwardIterator2>
inline void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
//concept requirements...
swap(*__a, *__b);
}
this might speed up sorting strings in particular (might become comparable to the set).
The problem is that the existing implementation failed to take advantage of overloaded swap functions and creates lots of temporaries, just to swap two strings:
Code:
template<typename _ForwardIterator1, typename _ForwardIterator2>
inline void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type
_ValueType1;
//concept requirements...
const _ValueType1 __tmp = *__a;
*__a = *__b;
*__b = __tmp;
}