This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unordered container insertion hints

Some feedback regarding this patch ?


On 05/15/2013 09:49 PM, François Dumont wrote:

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  <>

    * include/bits/hashtable_policy.h (_Insert_base): Consider hint in
    insert methods.
    * include/bits/hashtable.h: Likewise.
    * testsuite/23_containers/unordered_multimap/insert/ New.
    * doc/xml/manual/containers.xml: Document hitting in unordered


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]