Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue35884

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:Add variable access benchmark to Tools/Scripts
Type:performanceStage:resolved
Components:Demos and ToolsVersions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: miss-islington, rhettinger
Priority:normalKeywords:patch, patch

Created on2019-02-01 20:19 byrhettinger, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 11725mergedrhettinger,2019-02-01 20:24
PR 11725mergedrhettinger,2019-02-01 20:24
PR 11898mergedrhettinger,2019-02-16 20:32
PR 11905mergedscoder,2019-02-17 13:36
Messages (5)
msg334716 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-02-01 20:19
Adding a short script that I've found useful many times over the past decade. It has allowed my to quickly notice performance regressions and has helped identify places in need of optimization work.  It is also useful for building a empirical mental model of the relative cost of various kinds of variable access -- this is useful in writing high performance code.
msg334719 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-02-01 20:34
Here's what the output looks like (here am comparing a fresh Py3.8 with Clang versus the same build with GCC-8):$ make distclean && ./configure && make$ pyTools/scripts/var_access_benchmark.pySpeed of different kinds of variable accesses:   4.2 μsread_local   4.7 μsread_nonlocal  13.7 μsread_global  18.5 μsread_builtin  18.2 μsread_classvar  26.8 μsread_instancevar  20.3 μsread_instancevar_slots  19.1 μsread_namedtuple  26.9 μsread_boundmethod   4.5 μswrite_local   4.8 μswrite_nonlocal  18.8 μswrite_global  89.9 μswrite_classvar  37.1 μswrite_instancevar  25.7 μswrite_instancevar_slots   0.3 μsloop_overhead$ make distclean && ./configure CC=gcc-8 && make$ pyTools/scripts/var_access_benchmark.pySpeed of different kinds of variable accesses:   4.0 μsread_local   4.2 μsread_nonlocal  11.4 μsread_global  16.3 μsread_builtin  16.4 μsread_classvar  24.8 μsread_instancevar  20.1 μsread_instancevar_slots  16.8 μsread_namedtuple  23.2 μsread_boundmethod   4.3 μswrite_local   4.5 μswrite_nonlocal  15.4 μswrite_global  89.4 μswrite_classvar  33.5 μswrite_instancevar  24.5 μswrite_instancevar_slots   0.3 μsloop_overhead
msg334788 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-02-03 06:54
New changesetf75d59e1a896115bd52f543a417c665d6edc331f by Raymond Hettinger in branch 'master':bpo-35884: Add variable access benchmarking script (GH-11725)https://github.com/python/cpython/commit/f75d59e1a896115bd52f543a417c665d6edc331f
msg335718 -(view)Author: miss-islington (miss-islington)Date: 2019-02-16 20:51
New changeset43766f82ddec84fad7a321eeec2e1cbff6ee44d2 by Miss Islington (bot) (Raymond Hettinger) in branch 'master':bpo-35884: Add missing FIFO queue benchmark (GH-11898)https://github.com/python/cpython/commit/43766f82ddec84fad7a321eeec2e1cbff6ee44d2
msg338790 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-03-25 08:21
New changeset68d228f174ceed151200e7e0b44ffc5edd4e0ea2 by Raymond Hettinger (Stefan Behnel) in branch 'master':bpo-35884: Add string-keys-only microbenchmark for dict access to var_access_benchmark.py (GH-11905)https://github.com/python/cpython/commit/68d228f174ceed151200e7e0b44ffc5edd4e0ea2
History
DateUserActionArgs
2022-04-11 14:59:10adminsetgithub: 80065
2019-03-25 08:21:01rhettingersetmessages: +msg338790
2019-02-17 13:36:32scodersetpull_requests: +pull_request11931
2019-02-16 20:51:05miss-islingtonsetnosy: +miss-islington
messages: +msg335718
2019-02-16 20:32:50rhettingersetpull_requests: +pull_request11925
2019-02-03 06:55:59rhettingersetkeywords:patch,patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-02-03 06:54:58rhettingersetmessages: +msg334788
2019-02-01 20:34:35rhettingersetkeywords:patch,patch

messages: +msg334719
2019-02-01 20:24:54rhettingersetkeywords: +patch
stage: patch review
pull_requests: +pull_request11607
2019-02-01 20:24:50rhettingersetkeywords: +patch
stage: (no value)
pull_requests: +pull_request11606
2019-02-01 20:19:39rhettingercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp