This write-up discusses an aspect of JVM's just-in-time compilation around dynamic method disp atch. Following are the results from a run of 5 measurement iterations of JMH (Java micro-benchmarking harness) showing that JVM could perform 69 million operations in the bi-morphic case than just 62 million operations in mega-morphic case . And no matter how many times the benchmark is run, the results remain the same. This benchmark was executed against a Java 8 runtime, similar results appear if we run the same code against Java 10's latest update. The hierarchy of classes involved in this example is shown here: Above results are from a run of following benchmarking code and we can see there is literally no difference between the two methods being benchmarked . Then what just happened? In general, JVM knows (via just in time compilation) how many possible types exist for a polymorphic reference type. With this awareness, JIT c...