summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2023-04-24 22:22:14 (GMT)
committerGitHub <noreply@github.com>2023-04-24 22:22:14 (GMT)
commit0dc8b50d33208e9ca4fc3d959c6798529731f020 (patch)
tree822102a5177183fc6ad7075bd74a02a5633edc52 /Python/ceval.c
parent22bed58e531ce780d91f3364c5ace98fad28c2e8 (diff)
downloadcpython-0dc8b50d33208e9ca4fc3d959c6798529731f020.zip
cpython-0dc8b50d33208e9ca4fc3d959c6798529731f020.tar.gz
cpython-0dc8b50d33208e9ca4fc3d959c6798529731f020.tar.bz2
gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)
This speeds up `super()` (by around 85%, for a simple one-level `super().meth()` microbenchmark) by avoiding allocation of a new single-use `super()` object on each use.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3588350..5d5221b 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -21,6 +21,7 @@
#include "pycore_sliceobject.h" // _PyBuildSlice_ConsumeRefs
#include "pycore_sysmodule.h" // _PySys_Audit()
#include "pycore_tuple.h" // _PyTuple_ITEMS()
+#include "pycore_typeobject.h" // _PySuper_Lookup()
#include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS
#include "pycore_dict.h"