Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37158

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Speed-up statistics.fmean()
Type:performanceStage:resolved
Components:Library (Lib)Versions:Python 3.9, Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: steven.dapranoNosy List: rhettinger, steven.daprano
Priority:normalKeywords:patch

Created on2019-06-05 05:24 byrhettinger, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 13832mergedrhettinger,2019-06-05 05:31
PR 13843mergedmiss-islington,2019-06-05 14:40
Messages (5)
msg344670 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-06-05 05:24
fmean() can be sped-up by converting count() from a function to a generator and by using enumerate() to do the counting.-- Baseline ---$ ./python.exe -m timeit -r11 -s 'from statistics import fmean' -s 'data=list(map(float, range(1000)))' 'fmean(iter(data))'2000 loops, best of 11: 108 usec per loop-- Patched -- $ ./python.exe -m timeit -r11 -s 'from statistics import fmean' -s 'data=list(map(float, range(1000)))' 'fmean(iter(data))'5000 loops, best of 11: 73.1 usec per loop
msg344726 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-06-05 14:40
New changeset6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9 by Raymond Hettinger in branch 'master':bpo-37158: Simplify and speed-up statistics.fmean() (GH-13832)https://github.com/python/cpython/commit/6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9
msg344733 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-06-05 15:18
New changeset9ddb77741e041966d64739353393bcba33cc3bdd by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':bpo-37158: Simplify and speed-up statistics.fmean() (GH-13832) (GH-13843)https://github.com/python/cpython/commit/9ddb77741e041966d64739353393bcba33cc3bdd
msg344746 -(view)Author: Steven D'Aprano (steven.daprano)*(Python committer)Date: 2019-06-05 16:45
Nice! On my computer, I get about 30% speed up. Thanks Raymond.The two PRs are status "merged". Does this mean we can close this ticket or is there more to do? (The git workflow is still a mystery to me.)
msg344747 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-06-05 16:49
I can close it now :-)
History
DateUserActionArgs
2022-04-11 14:59:16adminsetgithub: 81339
2019-06-05 16:49:57rhettingersetstatus: open -> closed
resolution: fixed
messages: +msg344747

stage: patch review -> resolved
2019-06-05 16:45:20steven.dapranosetmessages: +msg344746
2019-06-05 15:18:26rhettingersetmessages: +msg344733
2019-06-05 14:40:07miss-islingtonsetpull_requests: +pull_request13720
2019-06-05 14:40:00rhettingersetmessages: +msg344726
2019-06-05 05:31:44rhettingersetkeywords: +patch
stage: patch review
pull_requests: +pull_request13711
2019-06-05 05:24:04rhettingercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp