GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-95913: Edit & expand Optimizations in 3.11 WhatsNew by CAM-Gerlach · Pull Request #98426 · python/cpython

Conversation

@CAM-Gerlach

@CAM-Gerlach CAM-Gerlach commented Oct 19, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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:

  • optimize int division #90564 Integer division // 20% faster
  • sum() several times slower on Python 3 64-bit #68264 sum() 30% faster
  • Streamline list.append for the common case #91165 list.append 15% faster / list comprehensions 20-30% faster
  • The speed of asyncio UDP is too slow when transferring large file #91487 asyncio.DatagramProtocol >100x faster on large files
  • Convert statistics sum of squares to a single pass algorithm #90415 statistics functions mean, variance and stdev 2x faster and less memory
  • Issue: Edit What's New for Python 3.11 #95913

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
CAM-Gerlach added 3 commits October 18, 2022 19:41
@CAM-Gerlach
Edit and xref Optimizations section
3c8f2a3
@CAM-Gerlach
Re-order by language (impact), builtins (impact), stdlib (a->z)
3d5f4c4
@CAM-Gerlach
Add additional significant optimizations mentioned in the changelog
c99b507
@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Oct 19, 2022
@CAM-Gerlach CAM-Gerlach changed the title gh-95913: Expand, edit, sort & xref Optimizations in 3.11 WhatsNew gh-95913: Edit & expand Optimizations in 3.11 WhatsNew Oct 19, 2022
@CAM-Gerlach CAM-Gerlach mentioned this pull request Oct 19, 2022
Edit What's New for Python 3.11 #95913
Closed
31 of 33 tasks
@CAM-Gerlach CAM-Gerlach added 3.11 only security fixes needs backport to 3.11 only security fixes labels Oct 19, 2022
@CAM-Gerlach
CAM-Gerlach requested review from JelleZijlstra, ezio-melotti and pablogsal October 19, 2022 02:42
@CAM-Gerlach
Add intro clarifying scope and linking to Faster CPython section
6d1c182
JelleZijlstra
JelleZijlstra reviewed Oct 19, 2022
View reviewed changes
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra approved these changes Oct 19, 2022
View reviewed changes
Fidget-Spinner
Fidget-Spinner reviewed Oct 19, 2022
View reviewed changes
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

CAM-Gerlach added 2 commits October 19, 2022 14:36
@CAM-Gerlach
Remove pythongh-91404 re entry from Optimizations to add to Faster CP…
e7a1a01
…ython
@CAM-Gerlach
Remove zero-cost exceptions from Optimization to move to Faster CPython
5dc4449
@CAM-Gerlach
CAM-Gerlach requested review from Fidget-Spinner and markshannon October 20, 2022 18:29
markshannon
markshannon reviewed Oct 21, 2022
View reviewed changes
Comment thread Doc/whatsnew/3.11.rst

* 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``.

@markshannon markshannon Oct 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@CAM-Gerlach CAM-Gerlach Oct 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@terryjreedy terryjreedy Oct 21, 2022

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pablogsal
pablogsal merged commit f58631b into python:main Oct 22, 2022
@miss-islington

miss-islington commented Oct 22, 2022

Copy link
Copy Markdown
Contributor

Thanks @CAM-Gerlach for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting review label Oct 22, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 22, 2022
@CAM-Gerlach @miss-islington
pythongh-95913: Edit & expand Optimizations in 3.11 WhatsNew (pythonG…
4b62f0d
…H-98426)

(cherry picked from commit f58631b)

Co-authored-by: C.A.M. Gerlach <[email protected]>
@bedevere-bot

bedevere-bot commented Oct 22, 2022

Copy link
Copy Markdown

GH-98554 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Oct 22, 2022
pablogsal pushed a commit that referenced this pull request Oct 22, 2022
@miss-islington @CAM-Gerlach
[3.11] gh-95913: Edit & expand Optimizations in 3.11 WhatsNew (GH-98426…
24e8d0c
…) (#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]>
pablogsal pushed a commit that referenced this pull request Oct 22, 2022
@miss-islington @CAM-Gerlach @pablogsal
[3.11] gh-95913: Edit & expand Optimizations in 3.11 WhatsNew (GH-98426…
92dc6ab
…) (#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon markshannon left review comments
@terryjreedy terryjreedy terryjreedy left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@pablogsal pablogsal Awaiting requested review from pablogsal
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.11 only security fixes docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@CAM-Gerlach @miss-islington @bedevere-bot @JelleZijlstra @markshannon @terryjreedy @Fidget-Spinner @pablogsal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.