-
-
Notifications
You must be signed in to change notification settings - Fork 37
Speed up arithmetic operations involving Proxy subclasses #18
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
Conversation
Speed up `Proxy__WRAPPED_REPLACE_OR_RETURN_NULL` for simple subclasses of `Proxy`
Good catch! Now I'm thinking we don't need to do a full |
I was thinking that too over lunch (it was a very lonely lunch :) |
Would you like me to update it to just remove the full |
Yes, lets try it. |
Also, update CHANGELOG/AUTHORS.rst. |
…heck since only actual subtypes will be compatible with this code anyways
Done--I agree it makes sense to submit the change upstream to wrapt as well. |
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
=========================================
- Coverage 93.81% 93.22% -0.6%
=========================================
Files 8 7 -1
Lines 2038 1594 -444
Branches 245 245
=========================================
- Hits 1912 1486 -426
+ Misses 101 83 -18
Partials 25 25
Continue to review full report at Codecov.
|
Allright, thanks! |
Thanks to you too! |
Published |
Arithmetic operations on subclasses of
Proxy
(specifically the C implementation) are slower (roughly three times) due to inexact match in thePyObject_Instance
call inProxy__WRAPPED_REPLACE_OR_RETURN_NULL
. For simple C-level type compatibility checkingPyObject_TypeCheck
is much faster. In fact thePyObject_IsInstance
is probably superfluous with this but I left it anyways.Before:
After: