-
Notifications
You must be signed in to change notification settings - Fork 788
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
hack: try removing error normalization #4859
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #4859 will degrade performances by 87.08%Comparing Summary
Benchmarks breakdown
|
Looks like (so far at least) the tests pass ok. The codspeed report suggests to me that:
|
The performance regressions seem to come from two cases:
I guess this also implies that we probably want to support a user-defined error type for |
That looks desirable to me, yes. I believe I have a branch somewhere that introduces |
Awesome that this is a significant net decrease in LOC and hopefully it's rare to create and then discard a PyErr in a non-error code path. Commenting to subscribe, but please feel free to ping me if you want my help with this. |
This is the most minimal diff I could write which removes the storage of "lazy" errors inside
PyErr
and instead eagerly creates Python exceptions at the point ofPyErr
creation.Related to #4584
Now that I push this diff, I see that it's pretty obvious that what this change mainly leads to is that we need a
Python<'py>
token to create aPyErr
(in this PR I do it just internally withPython::with_gil
, but maybe this links back to #4413 and we can do that at the same time).This is not ready to merge yet, I wanted to push it and see what happens in CI...