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

bpo-44525: Specialize calls to normal python classes #30415

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jan 5, 2022

Specializes calls to "normal" Python classes. That is, classes that inherit from object or other "normal" classes and do not override __new__.

The specialized form creates the object (self) pushes a shim frame to replace the result of __init__ with self and jumps into __init__.

Provides a ~1% speedup

https://bugs.python.org/issue44525

@markshannon
Copy link
Member Author

This needs one or two additional checks that the __init__ function's code object is of the correct form.

@markshannon
Copy link
Member Author

I'm closing this in favor of a two part specialization approach. See faster-cpython/ideas#210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants