Intuition vs. Reality: Surprising Truths in Python Performance
summary
Interactive benchmarks compare concrete snippets and tools: an async sleep left un-awaited returns immediately; counting evens shows len(listcomprehension) wins by ~>10% but allocates a new list so it trades memory for time; string concatenation with ''.join preallocates a buffer and is drastically faster; list comprehensions beat map+lambda due to fewer bytecode hops; small Rust calls lose to Python from conversion overhead while CPU-heavy Rust wins, and lazy conversion fixes binary‑search regression — measured with their CI tool and P99.
AI-written summary · about
chapters (18)
- 0:00Introduction to talk
- 1:13About CodeSpeed tool
- 2:57Why performance matters
- 4:03Performance intuition limits
- 5:08First performance quiz
- 6:57Counting even numbers
- 9:31Memory vs execution speed
- 11:57String concatenation
- 14:48List comprehension vs map
- 18:29Recursive vs stack factorial
- 20:36Python vs Rust basics
- 21:58Fibonacci in Rust
- 23:48Binary search comparison
- 26:23Rust rewriting pitfalls
- 26:44Quiz leaderboard reveal
- 27:05Talk takeaways
- 28:08CodeSpeed tool release
- 28:28Q&A session
related talks
14mOptimizing Go code without a blindfold
40mThe Modern Prometheus
31mMaking it Fast: The Power of Benchmarking
18mRun Fast! Catch Performance Regressions in Python
01h 31mDebugging and profiling techniques
02h 44mMeasure, don’t guess: benchmarking stories from the trenches
45mPerformance Benchmarking with Celero
43mStop Guessing and Start Measuring - Benchmarking in Practice
