Why is Python slow?
summary
CPython often shows concrete slowdowns on tight numeric loops: the n-body 7s vs 14min benchmark exposes the bytecode evaluation loop overhead. JITs win here — PyPy 650% faster on that workload — while V8 optimizes with SSA but at a memory cost — Node uses 4x memory for the same task. Measured tools include nbody, binary tree and TCP port scanner benchmarks; fixes discussed include Numba, PyPy, PGO, improved GC strategies and upcoming subinterpreters in 3.9/3.10.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:54What is Python
- 1:14C vs Python
- 4:00Stack frames
- 4:47C compiler
- 7:38JIT compiler
- 9:03JIT optimizations
- 11:49JIT compilers
- 13:53Intermediate representations
- 18:32C Python
- 21:02Other tasks
- 22:45Stop everything garbage collector
- 25:44Chromium Engine
- 27:28CPU intensive tasks
- 30:07Summary
related talks
26mWhy are Python and Ruby slow?
57mPython and PyPy performance (not) for dummies
28mWhy Python Loops Are "Slow": A Gentle Introduction to Interpretation, Bytecode, and Fast Code
22mPyPy in production
39mCPython, Grumpy, PyPy - When, How, Why
22mPyPy and the future of the Python ecosystem
01h 21mAccelerating Python With C++
22mPyPy hands-on
