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 · World Congress 2022

Upcoming sessions on this topic

Open session

World Congress 2026 North America

September 24, 2026 · 10:20–10:50

Stage 5

Vector, Graph, or Key Value? Choosing Your Agent's Memory

Elizabeth Fuentes Leone

AWS - Developer Advocate/SDE, GenAI

Elizabeth Fuentes Leone
Open session

World Congress 2026 North America

September 25, 2026 · 16:10–16:40

Stage 3

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

September 24, 2026 · 15:30–16:00

Stage 1

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

September 25, 2026 · 11:40–12:10

Stage 1

Context Engineering: How machines remember and forget

Emre Okcular

Solutions Architect at OpenAI

Emre Okcular
Open session

World Congress 2026 North America

September 25, 2026 · 11:40–12:10

Stage 9

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

September 25, 2026 · 16:00–16:10

Outdoor Stage

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

Hrushikesh Pokala

Senior Software Engineer Lead at Equifax

Hrushikesh Pokala