Why are interface method invocations slower than concrete invocations?

Viewed 11645

This is question comes in mind when I finding difference between abstract class and interface. In this post I came to know that interfaces are slow as they required extra indirection. But I am not getting what type of indirection required by the interface and not by the abstract class or concrete class.Please clarify on it. Thanks in advance

6 Answers

Interfaces are slower than abstract class as run time decision of method invocation would add little penalty of time,

However as JIT comes in picture which will take care of repeated calls of same method hence you may see the performance lag only in first call which is also very minimal,

Now for Java 8, they almost made abstract class useless by adding default & static function,

Related