The hidden costs of your favorite functions
summary
Shows that calling pop(0) shifts the whole list so pop(0) is O(n) while pop() is O(1), measured as ~20x slower on 100k items and >100x on 1M items. Demonstrates using a tracer profiler to get per-function time and call counts, finds a pandas compare where row iteration (iterrows) takes 478 ms, apply 110 ms and vectorized ops 2 ms on 11,717 tweets. Recommends profile, test alternatives, then monitor in production.
AI-written summary · about
chapters (7)
- 0:00Introduction and speaker intro
- 1:10Why code performance matters
- 3:18Hidden cost of list.pop()
- 8:17Using profilers to find bottlenecks
- 12:34Pandas performance comparison
- 16:07Monitoring and improving code
- 19:20Q&A
related talks
32mPandas May Be Slow, but Pandas Doesn't Have to Be
01h 31mDebugging and profiling techniques
29mI wish I learnt that earlier!
19mPython - best practices
31mFaster Pandas: Speed Up Your Code, Shrink Your Cloud Bill
35mFast Pandas Performance Tricks You Wish You Knew Earlier
29mMaking Pandas Fly
42mIntuition vs. Reality: Surprising Truths in Python Performance
