PyCon Israel 2022

πŸ‡ΊπŸ‡Έ Optimizing Code Performance for Python Internals
2022-06-29, 11:30–12:20, Main Hall

The Python interpreter plays a critical role in controlling the performance of your code, using a vast variety of optimizations & fast paths for common code patterns and idioms. This talk will walk you through how it can break or worsen performance.


The Python interpreter plays a critical role in controlling the performance of your code, using a vast variety of optimizations & fast paths for common code patterns and idioms. This talk will be a fun interactive session presented through code examples that display an assortment of those optimizations and in which (unexpected) ways they can break, worsening the performance of your Python code; we'll follow by inspecting CPython interpreter's inherent behavior to understand the reason for the breakage. The output and results just might surprise even the most advanced Python coders.

This talk will (partly) be based on some code samples I have contributed to the excellent wtfpython (https://github.com/satwikkansal/wtfpython) focused on Python quirks in general, with a touch of performance. Through these snippets we will learn some performance dos and don'ts, by understanding CPython internals and features under the hood.


Session language – English Target audience – Developers Other (target audience) – Developers / Platform Engineers