Closed
Description
This interacts poorly with with_capacity
since it will just end up shrinking the allocation immediately. It's very widely used since FromIter
uses it with the iterator size hint. Even in code that's not pre-allocating capacity, the resize strategy results in many reallocations as the hash table shrinks and then grows again. Allocator improvements are possible but this is always going to be extremely expensive for huge collections on most platforms.