-
Notifications
You must be signed in to change notification settings - Fork 82
Don't use exceptions for control flow #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use exceptions for control flow #274
Conversation
Oh noes you've offended RoboCop! |
Thanks I fixed it. |
Ran the
|
There's a benchmark in the linked issue as well (but with a slightly different patch). |
Yea, I just skimmed over that. The |
Super interesting, thanks for the PR! |
Using exceptions for control flow is slower than using conventional control flow in all implementations of Ruby I tried, and has particularly bad performance on optimising implementations of Ruby. This PR makes each test on a failing method overload 3x faster in MRI, and allows optimising implementations of Ruby like JRuby and TruffleRuby run it up to 10x faster than that.
truffleruby/truffleruby#697