3 ms·
Exceptions for control flow are a performance problem in most environments. The JVM does a good job of optimising exceptions very aggressively but throwing one
by peoplewindow 9y ago
Exceptions for control flow are a performance problem in most environments. The JVM does a good job of optimising exceptions very aggressively but throwing one is a relatively expensive operation if the JIT compiler wasn't able to fuse the throw/catch together. It's a bit weird to use exceptions for control flow for this reason.