-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Should DomainErrors accept arguments? #12152
Comments
Somehow I missed this comment. Yes, there might be a very small additional overhead but it doesn't not matter much since it's tiny compare to other overhead we pay when throwing an error.
|
@yuyichao It seems you're right. I did not realize how expensive it was to throw an exception. Given the cost I agree it's not worth worrying about the allocation overhead. |
@simonster Yeah I was a little shocked when I did the benchmark a while ago although it's kind of expected given how much we do before throwing the error..... Given #11508 cannot be merged/rebased until @vtjnash finishes the codegen refactoring and that it does not make throwing error 100% free for the normal path yet, the current strategy AFAICT is to use a specialized and non-inlined error thrower for the case where the function will not have GC root otherwise. (See @mbauman 's bound checking functions.) |
Ref: #9693 |
|
Is there an issue for the performance problems that are blocking this? |
#18521. Fixing this is quite a pileup of issues:
|
Re: #12121's discussion for @tkelman.
Right now,
DomainError
doesn't take any arguments and will throw aMethodError
if you try to pass an informative string. This is important because it's used in many performance critical math functions likesqrt
, cf. @andreasnoack. @simonster chimed in to point out thatand @yuyichao mentioned the performance regression discussed at #11508. @simonster pointed out that
What do we want to do going forward? Should we fix codegen, use #11508, or something else?
The text was updated successfully, but these errors were encountered: