Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Gurkenmaster
· 11y ago · 0 comments
The most expensive part of Java exceptions is building the stacktrace. You can avoid this by overriding the fillInStacktrace method with an empty implementation.
Comments
[–]
copsarebastards
11y ago
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.