- Home
- Courses
- Python for Software Engineers
- Async, Concurrency, Performance
Micro Free Course — 100% Free Learning
All lessons in this module are free to learn. Sign in with Google to save your progress.
Async, Concurrency, Performance
asyncio and the event loop; threading vs multiprocessing vs asyncio (and the GIL); generators, iterators, itertools; context managers and decorators; profiling with cProfile, py-spy, memray.
Module Content
Async/Await — How the Event Loop Works
The mental model of async Python. Single-threaded concurrency; coroutines yield control at I/O boundaries. FIND_VIDEO: search 'python asyncio event loop tutorial' — recommended channel: mCoding / ArjanCodes. Aim for 12 min or under.
Recap — When asyncio Helps and When It Doesn't
The patterns that benefit from async, common mistakes, and the libraries (httpx, asyncpg, aiofiles) that make async practical.
Threading vs Multiprocessing vs Asyncio
The three concurrency primitives. The GIL, when each beats the others, and how to pick. FIND_VIDEO: search 'python threading multiprocessing asyncio GIL' — recommended channel: mCoding / Real Python. Aim for 11 min or under.
Recap — The GIL and Picking the Right Primitive
What the GIL actually does, the decision matrix, and how Python 3.13's free-threaded mode changes the landscape.
Generators, Iterators & itertools
Lazy evaluation. Process huge datasets with O(1) memory; compose pipelines elegantly. FIND_VIDEO: search 'python generators iterators itertools tutorial' — recommended channel: mCoding / Raymond Hettinger. Aim for 10 min or under.
Recap — Memory-Efficient Pipelines and Lazy Evaluation
Generators vs lists, the itertools toolkit, and the patterns for streaming pipelines that don't OOM.
Context Managers & Decorators
Two of Python's most powerful abstractions. Build cleanup-safe code and reusable cross-cutting logic. FIND_VIDEO: search 'python decorators context managers tutorial' — recommended channel: ArjanCodes / Real Python. Aim for 10 min or under.
Recap — Building Reusable, Composable Abstractions
The decorator pattern with @functools.wraps, contextlib for context managers, and the patterns for production code.
Profiling & Optimization
Find what's slow before you optimize. cProfile, py-spy, memray — the right tool for the right symptom. FIND_VIDEO: search 'python profiling cProfile py-spy memray' — recommended channel: mCoding / Anthony Shaw. Aim for 10 min or under.
Recap — Profile First, Optimize After
The profiling toolkit, common Python performance traps, and the 80/20 of speedups.