-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-95913: Edit & expand Optimizations in 3.11 WhatsNew #98426
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
Conversation
|
||
* Pure ASCII strings are now normalized in constant time by :func:`unicodedata.normalize`. | ||
(Contributed by Dong-hee Na in :issue:`44987`.) | ||
* :func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sum()
is still much slower than 2.7.
Maybe we shouldn't mention this, until it is fixed in 3.12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, though on the other hand, it still a fairly substantial improvement over 3.10, the previous feature version, which seems to me is the main focus of this section—at least in the past, I'm not sure optimizations were only mentioned if they exceeded 2.7's speed for something, since that likely wasn't the case for quite a few of them. That said, I'm certainly not the expert here (unlike you all), and will of course defer to the judgement of @pablogsal as RM and you and rest of the core dev performance folks on whether this should be included, if you think its best left out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On discuss - release, Pable said "I don’t think there is anything wrong mentioning that is faster than the version in 3.10. After all there was work here to make the situation better and if true, I don’t see why a considerable improvement over the previous version should not be mentioned". Sum is not new, but since we have an optimization section, I agree.
Thanks @CAM-Gerlach for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…H-98426) (cherry picked from commit f58631b) Co-authored-by: C.A.M. Gerlach <[email protected]>
GH-98554 is a backport of this pull request to the 3.11 branch. |
…) (#98554) gh-95913: Edit & expand Optimizations in 3.11 WhatsNew (GH-98426) (cherry picked from commit f58631b) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
…) (#98554) gh-95913: Edit & expand Optimizations in 3.11 WhatsNew (GH-98426) (cherry picked from commit f58631b) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
Part of #95913
I've added Sphinx markup and cross references to the Optimizations section of the Python What's New document, copyedited the text to fix grammar errors, read better and be slightly clearer, and sorted it by language, then builtins, then standard library (sorted by module name).
Additionally, I've added a handful of additional optimizations to common functions with documented substantial (>=15%) performance increases mentioned in the changelog (that were unrelated to Faster CPython), and consistent with the existing optimizations mentioned here and in previous verisons. These are:
//
20% fastersum()
30% fasterlist.append
15% faster / list comprehensions 20-30% fasterasyncio.DatagramProtocol
>100x faster on large filesstatistics
functionsmean
,variance
andstdev
2x faster and less memory