Sanne/infinispan — comment on commit 32a1e8a8c5830b5f08e5030d0d3f7d47d1e25b1a
File: core/src/main/java/org/infinispan/transaction/xa/TransactionXaAdapter.java line 267
By Sanne:

because it's cost in terms of memory is very small but the hashCode() method is invoked thousands of times.
But the big change is not that much that we made it a constant, the trick going on here to get a good performance improvement is that we avoid the System.identityHashCode which is otherwise applied when not providing a hashCode() at all, making it a constant adds a small bit on top of that.