PR 54075 Restore 4.6 growth factor
François Dumont
frs.dumont@gmail.com
Sat Jul 28 21:18:00 GMT 2012
Hi
Here is the patch to restore the 4.6 growth factor of 2. I prefer
to validate the restored behavior by adding a performance test. Without
the patch the result was:
unordered_set.cc unordered_set 10000000 insertions 403r
329u 73s 402825280mem 0pf
after the patch:
unordered_set.cc unordered_set 10000000 insertions 112r
86u 25s 402825104mem 0pf
It validates the 3x times performance hint.
Tested under Linux x86_64.
2012-07-28 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/54075
* include/bits/hashtable_policy.h
(_Prime_rehash_policy::_M_next_bkt): Add a growth factor set to 2
to boost growth in the number of buckets.
* testsuite/performance/23_containers/insert/unordered_set.cc: New.
Even if it is not a Standard conformity issue I think we can apply it to
the 4.7 branch too.
François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hash_policy.patch
Type: text/x-patch
Size: 3749 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20120728/1727f49b/attachment.bin>
More information about the Libstdc++
mailing list