Concurrency and Performance
Doing many things at once (async, threads, processes) and making Python code faster.
This is an overview — pick a sub-topic below.
Sub-topics (6)
Asynchronous Programming with async and await
asyncio runs many I/O tasks concurrently in one thread using coroutines.
Multithreading
threading runs functions concurrently in one process — good for I/O-bound tasks.
Multiprocessing
multiprocessing runs code in separate processes, using multiple CPU cores for CPU-bound work.
Concurrency vs Parallelism
Concurrency is dealing with many tasks at once; parallelism is doing many at the same instant.
Parallel Computing
Splitting large computations across cores or machines with multiprocessing, Dask, Ray or MPI.
Performance Optimization
Profile first, then use better algorithms, built-ins, vectorisation or compiled code.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.