So here it is, the first method from the all new Shark, String.hashCode(). And the same method from old Shark for comparison. Some highlights:

  • The inner loop for the actual calculation is 18 instructions (down from 53)
  • A complete pass through the method when fetching a cached hashcode is 39 instructions (down from 66)

All in all I’m pretty pleased with myself.