The performance impact of using instanceof in Java
Approach I wrote a benchmark program to evaluate different implementations: instanceof implementation (as reference) object-orientated via an abstract class and @Override a test method using an own type implementation getClass() == _.class implementation I used jmh to run the benchmark with 100 warmup calls, 1000 iterations under measuring, and with 10 forks. So each option … Read more