[Bug libstdc++/50257] [C++0x] unordered_map slow initialization due to huge __prime_list
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Thu Sep 1 17:54:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-09-01
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Target Milestone|--- |4.7.0
Ever Confirmed|0 |1
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-01 17:54:14 UTC ---
Ah, very good. Thanks a lot for all your help. Indeed, I'm seeing similar
numbers on my machine. Thus, I would say, let's go with this kind of tweak for
now: indeed, it looks like an hack, but having default construction, move
constructor, faster is important, and as you noticed, it's also about having
the common case inline, vs the out of line lower_bound call. Also, I should
add, it's an hack, but I mild one, in my opinion, because we are doing it at an
abstraction level, _Prime_rehash_policy, which is exactly the same at which the
__prime_list is managed, thus we know for sure it begins by 2, etc. Only 10
it's a bit out of the blue at this level. Anyway, with another contributor, we
are also in the process of improving, streamlining, these _Prime_rehash_policy
functions for other reasons, I'll see later on if we can (re-)implement this
kind of tweak in a better way.
More information about the Gcc-bugs
mailing list