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-47189: What's New in 3.11: Faster CPython #32235

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Copy link
Contributor

@Fidget-Spinner Fidget-Spinner commented Apr 1, 2022

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

@Fidget-Spinner 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
@Fidget-Spinner
Copy link
Contributor Author

@Fidget-Spinner Fidget-Spinner commented Apr 1, 2022

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

Copy link
Member

@corona10 corona10 left a comment

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

@markshannon
Copy link
Member

@markshannon markshannon commented Apr 1, 2022

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

You deserve it.

Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Copy link
Member

@markshannon markshannon left a comment

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

@@ -62,6 +62,7 @@ Summary -- Release highlights
.. 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
Member

@markshannon markshannon Apr 1, 2022

Choose a reason for hiding this comment

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

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
Contributor Author

@Fidget-Spinner Fidget-Spinner Apr 2, 2022

Choose a reason for hiding this comment

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

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

Doc/whatsnew/3.11.rst Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.11.rst Show resolved Hide resolved
CPython 3.11 is on average `1.22x faster <https://github.com/faster-cpython/ideas/blob/main/main-vs-310.rst>`_
than CPython 3.10 when measured with the
`pyperformance <https://github.com/python/pyperformance>`_ benchmark suite, on
Ubuntu Linux. Depending on your workload, the speedup could be 10-60% faster.
Copy link
Contributor

@kumaraditya303 kumaraditya303 Apr 2, 2022

Choose a reason for hiding this comment

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

Should we mention compiler too? faster-cpython/ideas#331

Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
| Unpack | ``*seq`` | Specialized for common containers such as ``list`` | 8% | Brandt Bucher |
| Sequence | | and ``tuple``. Avoids internal calling convention. | | |
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
Copy link
Member

@sweeneyde sweeneyde Apr 2, 2022

Choose a reason for hiding this comment

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

There's also COMPARE_OP, if we want to include that.

Copy link
Contributor Author

@Fidget-Spinner Fidget-Spinner Apr 3, 2022

Choose a reason for hiding this comment

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

Yep. I left those out since they're less exciting/common operations.

Fidget-Spinner and others added 2 commits Apr 3, 2022
Co-Authored-By: Alex Waygood <Alex.Waygood@Gmail.com>
@Fidget-Spinner
Copy link
Contributor Author

@Fidget-Spinner Fidget-Spinner commented Apr 4, 2022

@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?

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 4, 2022

@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 :)

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