# Speed Up Your Python Program With Concurrency

DevFeed: [Speed Up Your Python Program With Concurrency](<https://devfeed.tech/articles/speed-up-your-python-program-with-concurrency-95793.md>)

Original publisher: [Read original article](<https://realpython.com/python-concurrency/>)

Author: Jim Anderson

Published: 2026-10-22T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>), [async](<https://devfeed.tech/topics/async.md>), [multithreading](<https://devfeed.tech/topics/multithreading.md>), [Process](<https://devfeed.tech/topics/process.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [asynchronous-programming](<https://devfeed.tech/tags/asynchronous-programming.md>), [asyncio](<https://devfeed.tech/tags/asyncio.md>), [await](<https://devfeed.tech/tags/await.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [i-o](<https://devfeed.tech/tags/i-o.md>), [multiprocessing](<https://devfeed.tech/tags/multiprocessing.md>), [python](<https://devfeed.tech/tags/python.md>), [threading](<https://devfeed.tech/tags/threading.md>)

## AI overview

For I/O-bound work, concurrency speeds programs by overlapping time spent waiting; for CPU-bound work in CPython, separate processes can run tasks across CPU cores. The tutorial compares a sequential downloader (about 14 seconds for 160 requests), a five-thread version (about 3.2 seconds), an `asyncio` version using the non-blocking `aiohttp` library (about 0.5 seconds), and a process pool (about 3.4 seconds). Threads require care with shared state and can introduce race conditions; asynchronous tasks scale with less overhead but need non-blocking libraries and can stall if a task fails to yield. For a recursive Fibonacci workload, threads were slightly slower than sequential execution and `asyncio` was much slower, while a process pool reduced runtime from about 35 to 10 seconds. Process pools add setup and communication costs, so the article recommends first confirming a performance problem, then matching the model to whether the workload waits on I/O or uses the CPU.

## Source excerpt

Explore Python concurrency with threading, asyncio, and multiprocessing, and learn which model speeds up your I/O-bound or CPU-bound programs.