Uh oh!
There was an error while loading. Please reload this page.
bpo-44525: Specialize for calls to type and other builtin classes with 1 argument. - #29942
Merged
markshannon merged 5 commits intoDec 15, 2021
Merged
Conversation
Fidget-Spinner
left a comment
Member
There was a problem hiding this comment.
The code LGTM. Interested to see the benchmark results.
markshannon
commented
Dec 7, 2021
MemberAuthor
Benchmark results show a slight speedup, but very close to noise. I think this is worth including because:
|
Fidget-Spinner
approved these changes
Dec 15, 2021
| assert(GET_CACHE()->adaptive.original_oparg == 1); | ||
| PyObject *obj = TOP(); | ||
| PyObject *callable = SECOND(); | ||
| DEOPT_IF(callable != (PyObject *)&PyType_Type, CALL_NO_KW); |
There was a problem hiding this comment.
I don't remember if you like using the Py_IS_TYPE inline function, but just mentioning it here and leaving it up to you :).
MemberAuthor
There was a problem hiding this comment.
I'll skip on the obfuscation macro 🙂
| return -1; | ||
| } | ||
| if (nargs == 1) { | ||
| if (tp == &PyType_Type) { |
markshannon
commented
Dec 15, 2021
MemberAuthor
Increases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://bugs.python.org/issue44525