"Performant Python"
summary
Uploader describes an intro to writing performant Python and the work focuses on CPython profiling with cProfile and visualization with snakeviz plus timeit for comparisons. A customer reports a 20x regression in JSON model deserialization; profiling surfaces a 709 recursive copy calls, a fallback serializer called across ~161,000 items and ~736,000 isinstance checks. Iterative fixes—remove repeated copies, eliminate the noop serializer, refactor to EAFP and reorder checks—cut runtime from ~36s down to ~3.38s, ~4x so far.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 2:12Why performance matters
- 5:43Profiling with cProfile
- 10:54Deserialization bottlenecks
- 13:47Optimizing functions step by step
- 17:59Validating with timeit
- 20:06Efficient Python from scratch
- 22:34Performance vs readability
- 24:21C extensions for performance
related talks
26mPython Performance at Scale - Making Python Faster at Instagram
30mWrite faster Python! Common performance anti patterns
37mTuning Python applications can dramatically increase performance
30mHow to Tune your Python Analysis Pipeline: A Profiler Guide
32mProfiling at the speed of light
01h 03mA tour of CPython's runtime
57mPython and PyPy performance (not) for dummies
01h 31mDebugging and profiling techniques
