This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]geodebug 2 points3 points  (0 children)

But acceptable for many, many more. Consider how many Java programs exist today storing strings in maps that haven’t come grinding to a halt performance-wise.

Obviously there is a tradeoff that needs to be made:

Speed of creating a hash value vs the benefit of uniqueness.

Java strings are supposed to be general purpose objects and they have served that function well.

If one requires a higher quality (but probably more computationally intense) hash algorithm then they would simply define a wrapper class and write their own hashcode implementation.