1

I've read this link The performance impact of using instanceof in Java, this is its citation:

Modern JVM/JIC compilers have removed the performance hit of most of the traditionally "slow" operations, including instanceof, exception handling, reflection, etc.

I'm wondering what JIT does with instanceOf operator. Is there any detail explanation. Thank you so much!

logbasex
  • 1,688
  • 1
  • 16
  • 22
  • 1
    It's really hard to give a detailed explanation of why that statement is true, without going way more in-depth than an SO question usually can (in other words: this could be a book). Basically the JVM can often optimize away assumptions that always (or almost always) hold by having a fast-path that only works in those cases and going to a very slow code path when it doesn't. And very often that very slow code path never gets used. – Joachim Sauer Feb 24 '20 at 18:11
  • @JoachimSauer: Thank you, at least I have an overview of it. I'll be better later on. – logbasex Feb 25 '20 at 17:02

0 Answers0