FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-47189: What's New in 3.11: Faster CPython by Fidget-Spinner · Pull Request #32235 · python/cpython · GitHub

Repository navigation

bpo-47189: What's New in 3.11: Faster CPython - #32235

Merged
Fidget-Spinner merged 20 commits into
python:mainfrom
Fidget-Spinner:faster_cpython_whatsnew
Apr 6, 2022
Merged

Fidget-Spinner merged 20 commits into
python:mainfrom
Fidget-Spinner:faster_cpython_whatsnew

Conversation

Fidget-Spinner commented Apr 1, 2022 •
edited
Loading

Copy link
Copy Markdown
Member

The static objects section's credits go to Kumar Aditya.

TODO:

  • Lazy __dict__ optimizations
  • [ ] dict memory saving optimizations by Inada-san, but I have no clue where to start for those

https://bugs.python.org/issue47189

bedevere-bot added the docs Documentation in the Doc dir label Apr 1, 2022
Fidget-Spinner changed the title What's New in 3.11: Faster CPython bpo-47189: What's New in 3.11: Faster CPython Apr 1, 2022

Copy link
Copy Markdown
Member Author

CC @gvanrossum @markshannon @brandtbucher @iritkatriel @sweeneyde @corona10 @kumaraditya303 @JelleZijlstra. For your opinions and review please (especially on the parts y'all contributed).

corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you, It is a great honor to see my name on the list.

Copy link
Copy Markdown
Member

Thank you, It is a great honor to see my name on the list.

You deserve it.

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for doing this. It is much appreciated.
I've left a few comments.

Comment thread Doc/whatsnew/3.11.rst Outdated
.. This section singles out the most important changes in Python 3.11.
Brevity is key.

- Python 3.11 is 22% faster than Python 3.10. See `Faster CPython`_ for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would rather claim a range, say 10% to 60%.

Once the latest PRs are merged it will be about 25%, if you must have a single number.

https://gist.github.com/markshannon/bf1b99177290db30dd0ab8f56446d0ea

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I will update this number when the benchmark link updates its values/ when those PRs are merged into main.

Comment thread Doc/whatsnew/3.11.rst
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst
Fidget-Spinner and others added 2 commits April 3, 2022 14:44
Co-Authored-By: Alex Waygood <Alex.Waygood@Gmail.com>

Copy link
Copy Markdown
Member Author

@pablogsal are you OK with this going into 3.11 whats new? Or would you prefer I host this somewhere else and link to it in the whatsnew?

Copy link
Copy Markdown
Member

@pablogsal are you OK with this going into 3.11 whats new? Or would you prefer I host this somewhere else and link to it in the whatsnew?

For the time leave it here in its own section as in this way I will be able to easily do the final edits. Removing or moving information is much easier to add it as that way I don't need to consider what may be missing :)

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I put my nit-picking hat on while reviewing this. :-) Overall great work, and can't wait to see this show up on docs.python.org!

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment on lines +624 to +625
| | | Calls to certain Python functions are inlined similar | | |
| | | to :ref:`inline-calls`. | | |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this an oblique reference to PRECALL_NO_KW_METHOD_DESCRIPTOR_O? Or does it refer to something else?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No, it just means that CALL_FUNCTION_EX for things like f(1, 2, *args, **kwargs) aren't inlined.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hm. It's rather subtle what you intend to say then. The text linked under inline-calls already describes Python-to-Python calls. But they are described here again because specialization adds... what again? It feels like claiming credit for the same optimization in two places. I do realize that there are two separate code changes, but to the readers of a high-level document like this that seems a bit too subtle.

Also, it's not clear for what operation you are claiming a 170% speedup (so a factor 2.7). The table layout makes it look like C(arg). But surely the speedup for class constructors is not a single extremely large number?

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst
Fidget-Spinner and others added 2 commits April 5, 2022 18:54
Co-Authored-By: Guido van Rossum <gvanrossum@users.noreply.github.com>
Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Comment thread Doc/whatsnew/3.11.rst Outdated

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Bunch of one-character nits. :-)

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Honestly this PR is so large and comments are flying so fast we should probably land it ASAP and then iterate.

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment on lines +624 to +625
| | | Calls to certain Python functions are inlined similar | | |
| | | to :ref:`inline-calls`. | | |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hm. It's rather subtle what you intend to say then. The text linked under inline-calls already describes Python-to-Python calls. But they are described here again because specialization adds... what again? It feels like claiming credit for the same optimization in two places. I do realize that there are two separate code changes, but to the readers of a high-level document like this that seems a bit too subtle.

Also, it's not clear for what operation you are claiming a 170% speedup (so a factor 2.7). The table layout makes it look like C(arg). But surely the speedup for class constructors is not a single extremely large number?

Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Comment thread Doc/whatsnew/3.11.rst Outdated
Co-Authored-By: Guido van Rossum <gvanrossum@users.noreply.github.com>

Fidget-Spinner commented Apr 6, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

Also, it's not clear for what operation you are claiming a 170% speedup (so a factor 2.7). The table layout makes it look like C(arg). But surely the speedup for class constructors is not a single extremely large number?

Oof the table layout worked against me. The 170% speedup is tied to "Calls to certain python functions are inlined", not C(arg). I have since removed that line altogether.

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks, this looks good now. Thanks very much for all your work on this!

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

Labels

docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL