26 points · by helwr · 16y ago · 6 comments
The performance improvement on large sets (millions) was dramatic. unordered_set really does average O(1) time complexity. However, it was slightly slower than binary_search on smaller sets, but not so much slower to matter.
Of course this presumes you know the distribution of keys. In many cases I don't think people know the distribution of keys, or even the values of the extremas.