[Bug libstdc++/54075] [4.7.1] unordered_map insert still slower than 4.6.2
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Thu Nov 8 01:56:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54075
--- Comment #42 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-08 01:56:15 UTC ---
On 11/08/2012 01:58 AM, Jonathan Wakely wrote:
> On 7 November 2012 22:02, François Dumont wrote:
>> Ok to commit ? If so, where ?
> That patch is OK for trunk and 4.7, thanks.
... I was having a look at this code - patch per se is straightforward
enough and can in any case go in now - and something is puzzling me a
lot: we always compute things, in _M_next_bkt etc, in terms of
__grown_n, thus __n * 2, until the final _M_rehash call.
On the other hand, the old-old code for rehash didn't use
_M_growth_factor in these computations, it just literally enforced the
post-conditions of the Standard. Are we sure we aren't so to speak
rehashing too much? For example, when the load factor is very low and
doesn't count, it looks like a current rehash(n) accomplishes the same
of an old rehash(n * 2)?!? Something seems wrong, can you double check
that? In any case the comments before _M_next_bkt would need fixing.
Thanks,
Paolo.
More information about the Gcc-bugs
mailing list