-
Notifications
You must be signed in to change notification settings - Fork 795
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
feature gate deprecated APIs for GILPool
#4181
Conversation
Some pieces of this don't feel super idiomatic -- |
Yeah, that one is one me. My only defence is that this is the result of actually collapsing another layer of indirection, i.e. #3166. But also have a look at #3685 where I introduced |
CodSpeed Performance ReportMerging #4181 will improve performances by 11.02%Comparing Summary
Benchmarks breakdown
|
I think there's a design question here, which is whether we want a new type, or we should just have |
The separate type seemed like the easier evolution but that approach has landed us in this mess in the first place. If |
IIRC, the main point was that |
src/gil.rs
Outdated
|
||
#[cfg(not(feature = "gil-refs"))] | ||
let result = { | ||
let _guard = GILGuard::acquire_unchecked(); |
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.
Ah, exactly, this is calling PyGILState_Ensure
for which there is no reason to in the entry points.
I think a |
Actually given both types will also be RAII on the internal |
I would suggest calling the One potential downside I would mention (but I have not measured it), is that this will mean that we could end up allocating unused stack space for Python's thread state in every entry point. Probably depends on whether the compiler will SROA-explode the type or not... |
I'll maybe get back to this today, or maybe not for a few days. If anyone else is champing at the bit to do that refactor, don't feel compelled to wait for me. Or I'll get to it later this week :-) |
Ah, true. I think the state returned by
Thinking further, I realise this is a non-argument as |
e4f8c73
to
19052c8
Compare
This is rebased and should be ready for review now. |
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.
🎉 wonderfully trivial now, thanks!
No description provided.