Skip to content
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

[mypyc] Use METH_FASTCALL with "__call__" #9946

Merged
merged 4 commits into from
Jan 23, 2021
Merged

[mypyc] Use METH_FASTCALL with "__call__" #9946

merged 4 commits into from
Jan 23, 2021

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jan 23, 2021

Allocate a vectorcall function pointer as a struct field for native
classes that include __call__, including nested functions. This
lets us use METH_FASTCALL wrapper functions with __call__
methods.

See https://www.python.org/dev/peps/pep-0590/ for details of why
we jump through these hoops.

This makes the nested_func microbenchmark about 1.5x faster.

Follow-up to #9894.

@JukkaL JukkaL merged commit 5aa707d into master Jan 23, 2021
@JukkaL JukkaL deleted the vectorcall-2 branch January 23, 2021 14:55
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