summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@fb.com>2021-03-20 19:12:05 (GMT)
committerGitHub <noreply@github.com>2021-03-20 19:12:05 (GMT)
commitee48c7d54147ae906776b9f6f96e8920e097d0c4 (patch)
treed13af349e31aedc614f885cd1eabd8813e1924d7 /Python/pythonrun.c
parent2fd16ef406bba239b1334057fb499496a84b3aa2 (diff)
downloadcpython-ee48c7d54147ae906776b9f6f96e8920e097d0c4.zip
cpython-ee48c7d54147ae906776b9f6f96e8920e097d0c4.tar.gz
cpython-ee48c7d54147ae906776b9f6f96e8920e097d0c4.tar.bz2
bpo-43452: Micro-optimizations to PyType_Lookup (GH-24804)
The common case going through _PyType_Lookup is to have a cache hit. There are some small tweaks that can make this a little cheaper: * The name field identity is used for a cache hit and is kept alive by the cache. So there's no need to read the hash code o the name - instead, the address can be used as the hash. * There's no need to check if the name is cachable on the lookup either, it probably is, and if it is, it'll be in the cache. * If we clear the version tag when invalidating a type then we don't actually need to check for a valid version tag bit.
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions