bpo-47189: What's New in 3.11: Faster CPython#32235
bpo-47189: What's New in 3.11: Faster CPython#32235Fidget-Spinner merged 20 commits intopython:mainpython/cpython:mainfrom Fidget-Spinner:faster_cpython_whatsnewFidget-Spinner/cpython:faster_cpython_whatsnewCopy head branch name to clipboard
Conversation
Co-Authored-By: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
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
There was a problem hiding this comment.
Thank you, It is a great honor to see my name on the list.
You deserve it. |
markshannon
left a comment
There was a problem hiding this comment.
Thanks for doing this. It is much appreciated.
I've left a few comments.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I will update this number when the benchmark link updates its values/ when those PRs are merged into main.
Co-Authored-By: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-Authored-By: Alex Waygood <Alex.Waygood@Gmail.com>
|
@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
There was a problem hiding this comment.
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!
Doc/whatsnew/3.11.rst
Outdated
| | | | Calls to certain Python functions are inlined similar | | | | ||
| | | | to :ref:`inline-calls`. | | | |
There was a problem hiding this comment.
Is this an oblique reference to PRECALL_NO_KW_METHOD_DESCRIPTOR_O? Or does it refer to something else?
There was a problem hiding this comment.
No, it just means that CALL_FUNCTION_EX for things like f(1, 2, *args, **kwargs) aren't inlined.
There was a problem hiding this comment.
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?
Co-Authored-By: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gvanrossum
left a comment
There was a problem hiding this comment.
Bunch of one-character nits. :-)
gvanrossum
left a comment
There was a problem hiding this comment.
Honestly this PR is so large and comments are flying so fast we should probably land it ASAP and then iterate.
Doc/whatsnew/3.11.rst
Outdated
| | | | Calls to certain Python functions are inlined similar | | | | ||
| | | | to :ref:`inline-calls`. | | | |
There was a problem hiding this comment.
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?
Co-Authored-By: Guido van Rossum <gvanrossum@users.noreply.github.com>
Oof the table layout worked against me. The 170% speedup is tied to "Calls to certain python functions are inlined", not |
gvanrossum
left a comment
There was a problem hiding this comment.
Thanks, this looks good now. Thanks very much for all your work on this!
The static objects section's credits go to Kumar Aditya.
TODO:
__dict__optimizations[ ]dictmemory saving optimizations by Inada-san, but I have no clue where to start for thosehttps://bugs.python.org/issue47189