Hacker News new | ask | show | jobs
by Gurkenmaster 4118 days ago
The most expensive part of Java exceptions is building the stacktrace. You can avoid this by overriding the fillInStacktrace method with an empty implementation.
1 comments

Or you could just have it not throw the exception in the first place and test the return code, which documents your control flow much more clearly.