This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


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

Re: String hashCode


>>>>> "Jeff" == Jeff Sturm <jeff.sturm@commerceone.com> writes:

Jeff> - Your performance scenario may not take cache behavior into
Jeff> consideration.  A binary tree can exhibit terrible spatial
Jeff> locality, causing several cache misses or even TLB misses in the
Jeff> during lookups, because nodes may not be allocated
Jeff> consecutively, or even close.  That may end up more expensive
Jeff> than rehashing in the worst case.

Interesting, thanks.

Jeff> - What do you think about preserving both a hashtable and map
Jeff> implementation in the source, so that one could be chosen at
Jeff> configure time?

I'm cool with that.  I'm not even convinced I should check in my
current implementation, given the number of comments I've seen.  Our
customer needed it, but I can continue to maintain the change as a
divergence if need be.

I think using a hashtable is as simple as changing a typedef to use
`hash_map' instead of `map'.

Tom

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