Unordered container insertion hints
François Dumont
frs.dumont@gmail.com
Wed May 15 19:49:00 GMT 2013
Hi
Here is a patch to consider the hint that users can give to
enhancement insertion performances. As you can see I only use it for
unordered_multi* containers to potentially avoid research within the
bucket nodes.
Note that I have use a call to _M_equals to avoid a hash code
computation when we end up inserting after the hint. It is an
optimization because I consider that _M_equals will be always faster
than a hash code computation. I think that I will submit an other patch
later to generalize this when possible to limit the small performance we
noticed when adopting the new data model (unless performance tests are
showing me that it is worst).
I try to document it. If you accept this patch tell me if it is
with or without the documentation cause I know that my English is not
good enough. I didn't find out how I can fix the doc URLs regarding
usage of hints in the std::unordered_* Doxygen comments.
2013-05-20 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h (_Insert_base): Consider hint in
insert methods.
* include/bits/hashtable.h: Likewise.
* testsuite/23_containers/unordered_multimap/insert/hint.cc: New.
* doc/xml/manual/containers.xml: Document hitting in unordered
containers.
François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hinting.patch
Type: text/x-patch
Size: 15312 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130515/94b79122/attachment.bin>
More information about the Libstdc++
mailing list