-
Notifications
You must be signed in to change notification settings - Fork 803
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
add Py2
as an internal API for optimization and dogfooding
#3445
Conversation
26cd4eb
to
a6a8ab0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea, thanks for biting the bullet. I'm still trying to think of a good name...
Some nits below...
958b8ee
to
56463b3
Compare
If there are no immediate concerns, I would be keen to merge this now I've pushed the coverage up. I think it'll be useful to keep anything else we build optimal. |
No concerns, but also did not find any time to actually look at this specific PR. |
Would you like me to hold until you've read it? I can also amend post merge if you're happy with that route. |
Is it really pressing, i.e. will this be part of 0.20? I suspect that this is basically what we discussed elsewhere quite in depth, so I am not particularly anxious. But I also do not really see a reason we would need to rush this? |
No urgency other than that I'm enthusiastic to make stuff go faster 😂 There's no API changes here though, so this can wait until 0.20.1 if needed. For 0.20 I'm just looking at various recent bug reports to understand if any need breaking changes to fix, and otherwise I'm hoping we can release within maybe a week. |
Revisiting this now that 0.20 is released, I benchmarked this branch against
I took a look into a couple of the bigger wins, and here's my explanation for them:
|
Overall, it looks like this PR is managing to already make a slight improvement to benchmarks. I'd really love to merge this and start submitting follow-up PRs to rework the rest of PyO3's types (internally) over the next patch release cycle. @adamreichold perhaps if you're still short on time at the moment, you'll forgive me if I merge this and get on with optimising? 🙏 |
56463b3
to
3f6089f
Compare
(force-pushed to rebase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not adamreichold but I'm happy if you merge :)
An approval is an approval, thanks! I can always submit follow-up PRs if @adamreichold wants to see changes later. I expect there will be a fair bit we'll learn by making these internals changes. 🚀 |
Now that I've read all the discussion again my preference is to call it |
454c923
to
cac95f3
Compare
The only reservation I have about the |
As you probably noticed, I am currently very much swamped by $DAYJOB and while I try to keep reading and take care of that little NumPy thing, I am rather happy if things are not blocked by me. And yes, a review is a review is a review. |
This PR adds the
Py2
struct andPyAnyMethods
trait from #3361 as private APIs which we can use internally.The idea is that: