Talks

Intuition vs. Reality: Surprising Truths in Python Performance

Friday, May 16th, 2025 1:45 p.m.–2:30 p.m. in Ballroom A

Experience Level:

Some experience

Description

How often do we trust our instincts when optimizing code? In Python, performance frequently defies intuition, leading us to make changes that might slow things down instead of speeding them up. This talk explores surprising truths about Python performance and showcases why measurement tools are essential for finding the real bottlenecks in our code.

Consider this: is it faster to count even numbers in a list using len([x for x in arr if x % 2 == 0]) or sum(1 for x in arr if x % 2 == 0)? While one might seem more Pythonic or efficient at first glance, the performance results might surprise you.

Through an interactive format, we’ll quiz you on performance scenarios using real-world examples. From counting even numbers to rewriting Python code in Rust, each case study will challenge assumptions about what makes code faster.

Plan:

  1. Introduction: Why intuition often fails in software performance
  2. Interactive performance case studies: Real-world examples that will surprise you
    • Counting even numbers
    • String concatenation
    • Pathfinding optimization
    • etc.
  3. Conclusion: How do we become consistent about optimizations?

By the end, you’ll understand why performance measurements matter and leave with practical insights and tools to improve Python performance systematically.

Search