Skip to content

[mypyc] feat: PyObject_CallObject op for fn(*args) fastpath #19631

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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

BobTheBuidler
Copy link
Contributor

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) or fn(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.

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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might be able to get rid of has_star2 entirely with this PR

@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: PyObject_CallObject op for fn(*args) [mypyc] feat: PyObject_CallObject op for fn(*args) fastpath Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant