This is the mail archive of the libstdc++@gcc.gnu.org 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: tr1::hashtable::operator[]


Peter Doerfler wrote:

The performance of your patch is the same as with mine for my testcase (which I find surprising, I thought there would be a slight benefit from the insert with hint).

Well, it depends on a lot of factors. For example, for the default allocator we are spending a big fraction of the total time allocating memory. Also, it depends on the load factor: when it's low the time spent in find_node is smaller (thus the expected advantage smaller).


I'm attaching a small artificial testcase that shows the effect. It's more drastic than my real use as the old implementation takes over a minute to complete against below 3 seconds for either patch.

Thanks a lot for the testcase and for your feedback!


Paolo.


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