The Backend Engineering Show with Hussein Nasser
The Backend Engineering Show with Hussein Nasser
Hussein Nasser
They made Python faster with this compiler option
29 minutes Posted May 7, 2024 at 12:20 am.
Intro
Fedora Linux gets Fast Python
What is Compiling?
Compiling with No Optimization
Compiling with -O1
Compiling with -O2
Compiling with -O3
Showing Numbers
0:00
29:04
Download MP3
Show notes
Fundamentals of Operating Systems Course
https://oscourse.win
Looks like fedora is compiling cpython with the -o3 flag, which does aggressive function inlining among other optimizations.
This seems to improve python benchmarks performance by at most 1.16x at a cost of an extra 3MB in binary size (text segment). Although it does seem to slow down some benchmarks as well though not significantly.
O1 - local register allocation, subexpression elimination
O2 - Function inlining only small functions
O3 - Agressive inlining, SMID
Backend Troubleshooting Course
https://performance.husseinnasser.com