[Bug libstdc++/54075] [4.7.1] unordered_map insert still slower than 4.6.2

Paolo Carlini paolo.carlini@oracle.com
Tue Nov 13 23:11:00 GMT 2012


On 11/13/2012 11:53 PM, Paolo Carlini wrote:
> To summarize my intuitions are (again, leaving out the final 
> technicalities)
>
>     a- std::hash specializations for scalar types -> no cache
>     b- std::hash specialization for for std::string (or maybe 
> everything else, for simplicity) -> cache
>     c- user defined functor -> cache or not basing on __is_noexcept_hash
Alternately, if we want to stress the consistency of our behavior, just 
a single rule: __is_noexcept_hash. That means I expect that b- above is 
normally penalized performance-wise, but we can document the behavior, 
the user can simply instantiate with a user defined hash functor which 
doesn't have noexcept on the call operator and just forwards to 
std::hash<std::string> and switch the container to caching.

Paolo.



More information about the Libstdc++ mailing list