classification
Title: Opcode predictions for asserts, class definitions, and some calls.
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: brandtbucher, rhettinger
Priority: normal Keywords: patch

Created on 2019-09-28 19:15 by brandtbucher, last changed 2019-09-29 00:13 by rhettinger. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16467 merged brandtbucher, 2019-09-28 19:15
Messages (3)
msg353472 - (view) Author: Brandt Bucher (brandtbucher) * (Python triager) Date: 2019-09-28 19:15
This patch adds four new opcode predictions:

BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX:
 - Emitted whenever more than one map of **kwargs is unpacked into a call.
 - Pair *always* occurs together.

LOAD_BUILD_CLASS -> LOAD_CONST:
 - Emitted whenever a class is defined *without* the use of cell vars.
 - Occurs ~93% of the time, in my analysis.

LOAD_BUILD_CLASS -> LOAD_CLOSURE:
 - Emitted whenever a class is defined *with* the use of cell vars.
 - Occurs the other ~7% of the time

LOAD_ASSERTION_ERROR -> RAISE_VARARGS:
 - Emitted whenever the one-argument form of "assert" is used.
 - Occurs ~91% of the time.
msg353475 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-09-29 00:12
New changeset f185a73249189bc3b75b4dc26e9ec2990a587b17 by Raymond Hettinger (Brandt Bucher) in branch 'master':
bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)
https://github.com/python/cpython/commit/f185a73249189bc3b75b4dc26e9ec2990a587b17
msg353476 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-09-29 00:13
Thanks for the patch :-)
History
Date User Action Args
2019-09-29 00:13:20rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg353476

stage: patch review -> resolved
2019-09-29 00:12:55rhettingersetmessages: + msg353475
2019-09-28 19:27:55rhettingersetassignee: rhettinger

nosy: + rhettinger
2019-09-28 19:15:23brandtbuchersetkeywords: + patch
stage: patch review
pull_requests: + pull_request16051
2019-09-28 19:15:08brandtbuchercreate