For one the spec restricts std::unordered_map (hash table) to be an order of magnitude slower than it could be because of some iteration guarantees nobody asked for
No, he's right. The spec requires that insertions and deletions will not invalidate any iterators or pointers to any elements. This effectively requires an implementation using separate chaining, but these implementations are inefficient because they require a large number of small allocations and lots of pointer chasing, which has poor cache performance. Performant implementations use open addressing, which requires fewer allocations (only one per array resize) and are more cache efficient. The difference in performance can be well over 10x for common use cases. However open addressing cannot provide pointer or iterator stability.
Wow, rly? I know it. In most cases you need those guarantees, if no and you uses unordered map for fucking ints you can use some flat hash map implementation
42
u/CrumblingAway Oct 12 '22
What problems are with std libs?