In the Exceptions chapter in Effective Java:
Placing code inside a try-catch block blocks certain optimizations that otherwise JVM implementations might perform
Why and how does a try-catch block prevent JVM optimization?
"" , ; , . , , JIT , .
JIT , . :
, . , ( ) , . , , , (, , ,...) .
JVM try/catch , try/catch. . , JVM, , , , .
:
Java?
I think exceptions are Java objects, and these objects need to be created. Creating an object is an expensive operation. Therefore, use exceptions only for error handling and not for flow control.