On Fri, Feb 7, 2020 at 2:47 PM David Holmes <david.hol...@oracle.com> wrote:
> Hi Martin, > > On 8/02/2020 3:10 am, Martin Buchholz wrote: > > I explored System.identityHashCode (see below). > > System.identityHashCode is a VM call that is potentially very expensive. > In the worst-case it triggers monitor inflation. > I can believe that. The VM can't simply return the address of an object because ... the object might move and an address is a poor hash code because low bits will tend to be zero. But IdentityHashMap already calls System.identityHashCode - that price must be paid. My proposal is still "Let's trust System.identityHashCode to produce acceptable hash codes"