Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
markshannon wants to merge 7 commits intopython:mainpython/cpython:mainfrom
faster-cpython:specialize-calls-to-normal-python-classesfaster-cpython/cpython:specialize-calls-to-normal-python-classesCopy head branch name to clipboard
Closed

bpo-44525: Specialize calls to normal python classes#30415
markshannon wants to merge 7 commits intopython:mainpython/cpython:mainfrom
faster-cpython:specialize-calls-to-normal-python-classesfaster-cpython/cpython:specialize-calls-to-normal-python-classesCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.