World Congress 2023 Aug 11, 2023

Python: Behind the Scenes

Diana Gastrin

Did you know adding `__slots__` can slash a Python object's memory footprint by over 80%? Uncover the interpreter's hidden mechanics to write drastically leaner, performant code.

Pause
Mute Enter Fullscreen
#1 about 4 min

Python data abstraction and foundational object attributes

Python abstracts data into objects through memory allocation tracking, dynamic typing, and reference counting.

#2 about 3 min

Memory optimization using mutable and immutable object values

Utilizing immutable objects and defining class memory slots minimizes application memory footprint sizes.

#3 about 2 min

Static versus dynamic typing and duck typing implementation

Dynamic type pointers circumvent strict variable definitions by evaluating objects based on functional capabilities.

#4 about 6 min

Resolving variable scope using execution symbol tables

Tracing local, enclosing, global, and built-in symbol tables prevents unexpected unbound variable execution errors.

#5 about 2 min

Emulating private methods using class name mangling

Python avoids strict access control restrictions by transforming private method definitions with class identifier prefixes.

#6 about 4 min

Object evaluation rules and boolean short-circuit logic

Evaluating truth states of blank data structures enables efficient short-circuiting for complex conditional operations.

#7 about 3 min

Comparison chaining and memory caching for small objects

Caching integer ranges and interning standard strings optimizes memory usage for common conditional operations.

#8 about 4 min

Conclusive questions on memory optimization and variable scope

Addressing global scope management and database mapping optimization helps enforce readable code formatting conventions.

Matching moments

1:56 min

Evaluating object memory references and namespace resolution

Oliver Bestwalter · LIVE

1:32 min

Evaluating absolute performance thresholds between Python and procedural syntaxes

Paul Graham Paul Graham · LIVE

3:01 min

Applying targeted just-in-time compilation rules with Python Numba

Paul Graham Paul Graham · LIVE

8:29 min

Discussion on JIT memory parameters and cross-language benchmarking

Daniel Strmečki · LIVE

4:38 min

Exploring the inherent mutability of Python built-in attributes

Oliver Bestwalter · LIVE

2:50 min

Dispelling common optimization and runtime performance misconceptions

Bjarne Stroustrup · WWC 2022

Upcoming sessions on this topic

Open session

World Congress 2026 North America

Building World-Aware Robots with Agent Memory and Context Graphs

Zaid Zaim

Developer Advocate EMEA at Neo4j | Microsoft AI MVP

Zaid Zaim
Open session

World Congress 2026 North America

KV Cache Is Not About Speed: It's About Surviving Inference Costs

David vonThenen

AI/ML Leader | Keynote Speaker | OSS Engineer & Developer Advocate | Agentic AI, Deep Learning, Production AI | Python, Go, C++

David vonThenen
Open session

World Congress 2026 North America

You Can’t Re-Run Sunlight: Designing ML Data Architectures for Physical AI

An Phan

Senior Data Infrastructure Engineer @ Hippo Harvest

An Phan
Open session

World Congress 2026 North America

public void saveMoney(AI): The Developer's Guide to Unit Economics

Hrushikesh Pokala

Senior Software Engineer Lead at Equifax

Hrushikesh Pokala
Open session

World Congress 2026 North America

When Humans Stop Writing Code: Rethinking Languages, Compilers, and Responsibility

Simon Auer

Organizer of flutter vienna meetup and CEO of marqably

Simon Auer
Open session

World Congress 2026 North America

Offloading IoT State: Solving the Memory Crisis on Legacy Hardware

Pravin Nagare

Senior Software Engineer, Roku

Pravin Nagare