Skip to content

Conversation

@rhettinger
Copy link
Contributor

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

@rhettingerrhettinger added performance Performance or resource usage skip issue skip news 3.14 bugs and security fixes labels May 31, 2024
@AlexWaygoodAlexWaygood changed the title Speed-up code path for non-sizeable inputs.statistics.fmean: speed-up code path for non-sizeable inputs.May 31, 2024
@rhettingerrhettinger merged commit cc5cd4d into python:mainMay 31, 2024
@rhettingerrhettinger 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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com>
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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com>
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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com> * convert to markdown * add to index * update more of the out of date stuff --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Daniel Porteous <danielporteous1@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Georg Brandl <georg@python.org> Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Jeff Allen <ja.py@farowl.co.uk> Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Muhammad Mahad <mahadpy@gmail.com> Co-authored-by: Ned Deily <nad@acm.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> Co-authored-by: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com> Co-authored-by: psyker156 <242220+psyker156@users.noreply.github.com> Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> Co-authored-by: svelankar <17737361+svelankar@users.noreply.github.com> Co-authored-by: zikcheng <surfingbyte@gmail.com>
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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com> * convert to markdown * add to index * update more of the out of date stuff --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Daniel Porteous <danielporteous1@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Georg Brandl <georg@python.org> Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Jeff Allen <ja.py@farowl.co.uk> Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Muhammad Mahad <mahadpy@gmail.com> Co-authored-by: Ned Deily <nad@acm.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> Co-authored-by: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com> Co-authored-by: psyker156 <242220+psyker156@users.noreply.github.com> Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> Co-authored-by: svelankar <17737361+svelankar@users.noreply.github.com> Co-authored-by: zikcheng <surfingbyte@gmail.com>
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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com> * convert to markdown * add to index * update more of the out of date stuff --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Daniel Porteous <danielporteous1@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Georg Brandl <georg@python.org> Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Jeff Allen <ja.py@farowl.co.uk> Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Muhammad Mahad <mahadpy@gmail.com> Co-authored-by: Ned Deily <nad@acm.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> Co-authored-by: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com> Co-authored-by: psyker156 <242220+psyker156@users.noreply.github.com> Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> Co-authored-by: svelankar <17737361+svelankar@users.noreply.github.com> Co-authored-by: zikcheng <surfingbyte@gmail.com>
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 <9087854+AA-Turner@users.noreply.github.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-Authored-By: Brett Cannon <brett@python.org> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Daniel Porteous <danielporteous1@gmail.com> Co-Authored-By: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-Authored-By: Éric Araujo <merwok@netwok.org> Co-Authored-By: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Georg Brandl <georg@python.org> Co-Authored-By: Guido van Rossum <guido@python.org> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-Authored-By: Jeff Allen <ja.py@farowl.co.uk> Co-Authored-By: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-Authored-By: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-Authored-By: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-Authored-By: Mariatta <Mariatta@users.noreply.github.com> Co-Authored-By: Muhammad Mahad <mahadpy@gmail.com> Co-Authored-By: Ned Deily <nad@acm.org> Co-Authored-By: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be> Co-Authored-By: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-Authored-By: Zachary Ware <zachary.ware@gmail.com> Co-Authored-By: psyker156 <242220+psyker156@users.noreply.github.com> Co-Authored-By: slateny <46876382+slateny@users.noreply.github.com> Co-Authored-By: svelankar <17737361+svelankar@users.noreply.github.com> Co-Authored-By: zikcheng <surfingbyte@gmail.com> * convert to markdown * add to index * update more of the out of date stuff --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: Daniel Porteous <danielporteous1@gmail.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: Georg Brandl <georg@python.org> Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Jeff Allen <ja.py@farowl.co.uk> Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Muhammad Mahad <mahadpy@gmail.com> Co-authored-by: Ned Deily <nad@acm.org> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stéphane Wirtel <stephane@wirtel.be> Co-authored-by: Suriyaa ✌️️ <isc.suriyaa@gmail.com> Co-authored-by: Zachary Ware <zachary.ware@gmail.com> Co-authored-by: psyker156 <242220+psyker156@users.noreply.github.com> Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> Co-authored-by: svelankar <17737361+svelankar@users.noreply.github.com> Co-authored-by: zikcheng <surfingbyte@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.14bugs and security fixesperformancePerformance or resource usageskip issueskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@rhettinger