cpython: cfc956f13ce2 (original) (raw)

Mercurial > cpython

changeset 105122:cfc956f13ce2

Issue #28618: Mark dict lookup functions as hot It's common to see these functions in the top 3 of "perf report". [#28618]

Victor Stinner victor.stinner@gmail.com
date Tue, 15 Nov 2016 15:13:40 +0100
parents ac93d188ebd6
children 1f0b0ecf7dc1
files Include/pyport.h Objects/dictobject.c
diffstat 2 files changed, 6 insertions(+), 6 deletions(-)[+] [-] Include/pyport.h 4 Objects/dictobject.c 8

line wrap: on

line diff

--- a/Include/pyport.h +++ b/Include/pyport.h @@ -498,7 +498,7 @@ extern "C" { #endif -/* Py_HOT_FUNCTION +/* _Py_HOT_FUNCTION

--- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -683,7 +683,7 @@ the value. For both, when the key isn't found a DKIX_EMPTY is returned. hashpos returns where the key index should be inserted. */ -static Py_ssize_t +static Py_ssize_t _Py_HOT_FUNCTION lookdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr, Py_ssize_t hashpos) { @@ -798,7 +798,7 @@ top: } / Specialized version for string-only keys */ -static Py_ssize_t +static Py_ssize_t _Py_HOT_FUNCTION lookdict_unicode(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr, Py_ssize_t *hashpos) { @@ -873,7 +873,7 @@ lookdict_unicode(PyDictObject mp, PyObj / Faster version of lookdict_unicode when it is known that no keys

@@ -941,7 +941,7 @@ lookdict_unicode_nodummy(PyDictObject *m

{