DESCRIPTION

Improve performance of GitModelCommit.hashCode()

Use xor operation instead of adding and multiplying ObjectId.hashCode().

Change-Id: Ibb8567a8594bab7d25441e72f5ec614a8a184dff
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Anonymous Coward
date: 2010-08-21 20:25:49.000000000

Patch Set 1:

Doesn't this also increase the change of hashCode collisions, therefore reducing the performance of using GitModelCommit in HashMaps and the like?

-------------------------------------
author: Juliet Cantu
date: 2010-08-22 07:38:16.000000000

Patch Set 1: Looks good to me, approved

the hashCode we xor with are well distributed, ie. think of them as random bits, therefor xoring them should continue to be random bits.

THe multiplication with a prime that is so common in hash code calculations is used to spread the values when the input is not a good hash by itself.

-------------------------------------
author: Juliet Cantu
date: 2010-08-22 07:38:28.000000000

Patch Set 1: IP review completed



-------------------------------------
author: Juliet Cantu
date: 2010-08-22 07:38:29.000000000

Change has been successfully merged into the git repository.

-------------------------------------
