Overview
Syllabus
Intro
FAT Python New static optimizer for CPython 3.6
Faster Python
New optimizer?
Simplified goal
My previous attempts
Namespace guards
Specialize code
AST Abstract Syntax Tree
AST optimizer
Call builtin functions
Simplify iterables
Loop unrolling
Copy constants
Constant folding
3 Copy to constants Python code: def func(obj): return len obj
(3) Remove dead code if test
PEP 509: dict version • Add a version to Python dict
PEP 510: Specialize def func
PEP 511: Transformer • Add-o command line option
Python 3.6? . Good feedback on the 3 PEPS
Remove unused vars print 1
Copy globals
Function inlining
Profiling • Run the application in a profiler
Taught by
EuroPython Conference