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

statistics.fmean: speed-up code path for non-sizeable inputs. #119876

Merged
merged 1 commit into from
May 31, 2024

Conversation

rhettinger
Copy link
Contributor

Simplify and speed-up the input count logic in fmean(). Inspired by a more-itertools suggestion from Alun Champion.

@rhettinger rhettinger added performance Performance or resource usage skip issue skip news 3.14 new features, bugs and security fixes labels May 31, 2024
@AlexWaygood AlexWaygood changed the title Speed-up code path for non-sizeable inputs. statistics.fmean: speed-up code path for non-sizeable inputs. May 31, 2024
@rhettinger rhettinger merged commit cc5cd4d into python:main May 31, 2024
36 checks passed
@rhettinger rhettinger deleted the fmean_optimization branch May 31, 2024 22:09
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Jun 5, 2024
Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Jun 6, 2024
Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>
iritkatriel added a commit that referenced this pull request Jun 10, 2024
…t to markdown (#120134)

* gh-119876: move compiler doc from devguide to InternalDocs

Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>

* convert to markdown

* add to index

* update more of the out of date stuff

---------

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Daniel Porteous <[email protected]>
Co-authored-by: Dennis Sweeney <[email protected]>
Co-authored-by: Éric Araujo <[email protected]>
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Georg Brandl <[email protected]>
Co-authored-by: Guido van Rossum <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Jeff Allen <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Lincoln <[email protected]>
Co-authored-by: Mariatta <[email protected]>
Co-authored-by: Muhammad Mahad <[email protected]>
Co-authored-by: Ned Deily <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stéphane Wirtel <[email protected]>
Co-authored-by: Suriyaa ✌️️ <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>
Co-authored-by: psyker156 <[email protected]>
Co-authored-by: slateny <[email protected]>
Co-authored-by: svelankar <[email protected]>
Co-authored-by: zikcheng <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
…convert to markdown (python#120134)

* pythongh-119876: move compiler doc from devguide to InternalDocs

Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>

* convert to markdown

* add to index

* update more of the out of date stuff

---------

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Daniel Porteous <[email protected]>
Co-authored-by: Dennis Sweeney <[email protected]>
Co-authored-by: Éric Araujo <[email protected]>
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Georg Brandl <[email protected]>
Co-authored-by: Guido van Rossum <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Jeff Allen <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Lincoln <[email protected]>
Co-authored-by: Mariatta <[email protected]>
Co-authored-by: Muhammad Mahad <[email protected]>
Co-authored-by: Ned Deily <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stéphane Wirtel <[email protected]>
Co-authored-by: Suriyaa ✌️️ <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>
Co-authored-by: psyker156 <[email protected]>
Co-authored-by: slateny <[email protected]>
Co-authored-by: svelankar <[email protected]>
Co-authored-by: zikcheng <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…convert to markdown (python#120134)

* pythongh-119876: move compiler doc from devguide to InternalDocs

Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>

* convert to markdown

* add to index

* update more of the out of date stuff

---------

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Daniel Porteous <[email protected]>
Co-authored-by: Dennis Sweeney <[email protected]>
Co-authored-by: Éric Araujo <[email protected]>
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Georg Brandl <[email protected]>
Co-authored-by: Guido van Rossum <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Jeff Allen <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Lincoln <[email protected]>
Co-authored-by: Mariatta <[email protected]>
Co-authored-by: Muhammad Mahad <[email protected]>
Co-authored-by: Ned Deily <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stéphane Wirtel <[email protected]>
Co-authored-by: Suriyaa ✌️️ <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>
Co-authored-by: psyker156 <[email protected]>
Co-authored-by: slateny <[email protected]>
Co-authored-by: svelankar <[email protected]>
Co-authored-by: zikcheng <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…convert to markdown (python#120134)

* pythongh-119876: move compiler doc from devguide to InternalDocs

Copy of python/devguide@78fc0d7

Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Adam Turner <[email protected]>
Co-Authored-By: Brett Cannon <[email protected]>
Co-Authored-By: Carol Willing <[email protected]>
Co-Authored-By: Daniel Porteous <[email protected]>
Co-Authored-By: Dennis Sweeney <[email protected]>
Co-Authored-By: Éric Araujo <[email protected]>
Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ezio Melotti <[email protected]>
Co-Authored-By: Georg Brandl <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Hugo van Kemenade <[email protected]>
Co-Authored-By: Irit Katriel <[email protected]>
Co-Authored-By: Jeff Allen <[email protected]>
Co-Authored-By: Jim Fasarakis-Hilliard <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Lincoln <[email protected]>
Co-Authored-By: Mariatta <[email protected]>
Co-Authored-By: Muhammad Mahad <[email protected]>
Co-Authored-By: Ned Deily <[email protected]>
Co-Authored-By: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Serhiy Storchaka <[email protected]>
Co-Authored-By: Stéphane Wirtel <[email protected]>
Co-Authored-By: Suriyaa ✌️️ <[email protected]>
Co-Authored-By: Zachary Ware <[email protected]>
Co-Authored-By: psyker156 <[email protected]>
Co-Authored-By: slateny <[email protected]>
Co-Authored-By: svelankar <[email protected]>
Co-Authored-By: zikcheng <[email protected]>

* convert to markdown

* add to index

* update more of the out of date stuff

---------

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Daniel Porteous <[email protected]>
Co-authored-by: Dennis Sweeney <[email protected]>
Co-authored-by: Éric Araujo <[email protected]>
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Georg Brandl <[email protected]>
Co-authored-by: Guido van Rossum <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Jeff Allen <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Ken Jin <[email protected]>
Co-authored-by: Lincoln <[email protected]>
Co-authored-by: Mariatta <[email protected]>
Co-authored-by: Muhammad Mahad <[email protected]>
Co-authored-by: Ned Deily <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stéphane Wirtel <[email protected]>
Co-authored-by: Suriyaa ✌️️ <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>
Co-authored-by: psyker156 <[email protected]>
Co-authored-by: slateny <[email protected]>
Co-authored-by: svelankar <[email protected]>
Co-authored-by: zikcheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes performance Performance or resource usage skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant