Recent Performance Improvements in Function Calls in CPython

The author discusses the performance improvements in Python regarding function calls and inlining code in hot loops. They analyze three benchmarks showcasing the impact of recent optimizations in CPython releases. Specifically, the introduction of super instructions and bytecode instruction specialization has enhanced the efficiency of the interpreter and CPU. Switching from tp_call to vectorcall for min and max built-ins has significantly boosted performance. Inlining Python-to-Python function calls in newer versions like CPython 3.11 has made these calls faster and smoother. Overall, Python continues to strive for faster and more efficient performance improvements to benefit developers.

https://blog.codingconfessions.com/p/are-function-calls-still-slow-in-python

To top