Speed up hashcode calculation for entity. Provides massive performance
improvements.