[mypyc] feat: PyObject_CallObject op for fn(*args) fastpath#19631
Merged
JukkaL merged 33 commits intopython:masterfrom Aug 26, 2025
Merged
[mypyc] feat: PyObject_CallObject op for fn(*args) fastpath#19631JukkaL merged 33 commits intopython:masterfrom
JukkaL merged 33 commits intopython:masterfrom
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
BobTheBuidler
commented
Aug 11, 2025
| # if star_result is a tuple we took the fast path | ||
| star_result = self.primitive_op(list_tuple_op, [star_result], line) | ||
| if has_star2 and star2_result is None: | ||
| if has_star2 and star2_result is None and len(star2_keys) > 0: |
Contributor
Author
There was a problem hiding this comment.
I think we might be able to get rid of has_star2 entirely with this PR
JukkaL
reviewed
Aug 19, 2025
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Tests are failing -- can you have a look? Also, it would be good to check if the changes in this PR (and also the previous related PRs) are covered by run tests and add some if there are gaps in coverage.
Contributor
Author
|
IR tests are fixed, I still need to add run tests |
Contributor
Author
|
I added the same new test cases on both this PR and on #19630 |
for more information, see https://pre-commit.ci
JukkaL
approved these changes
Aug 26, 2025
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Thanks! I verified that this makes a micro-benchmark 1.2x faster.
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 free
to 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.
This PR adds a new custom_op for PyObject_CallObject which is more efficient than PyObject_Call in cases where there are no kwargs. posarg-only use cases are already optimized but this is helpful for patterns such as
fn(*args)orfn(a1, a2, *args)This PR extends #19623 and #19629 , as this change will not be helpful until those PRs are merged.
I will rebase this PR on top as we go to keep everything as easy to review as possible.