Overview
Explore the past, present, and future of CPython performance optimization in this 29-minute PyCon US talk by Mark Shannon. Discover the strategies behind Python 3.11's significant speed improvements and learn about upcoming enhancements for future releases. Gain insights into the high-level approach for accelerating CPython, explained through simple diagrams, examples, and basic math concepts. Understand key optimization techniques, including region formation, specialization, and partial evaluation. Examine where execution time is spent and how various aspects of the runtime are considered to achieve substantial speedups. Get a glimpse into potential performance gains for upcoming Python versions and the language's overall speed potential.
Syllabus
Intro
Time vs Speed
Achieving 5x speedup Equivalent to a 80% reduction in execution time
Need to consider all aspects of the runtime
Where is the time spent?
General Principles
Example class and instance
The early days
Python object
Interlude: Bytecode
The past
The future
Region formation
Specialization
Partial Evaluation
Optimization techniques
Conclusions
Taught by
PyCon US