SuperFastPython Tutorial Archive
- Concurrent File I/O (17)
- Concurrent NumPy (42)
- Python Asyncio (174)
- Python Benchmarking (49)
- Python Concurrency (3)
- Python Multiprocessing (89)
- Python Multiprocessing Pool (62)
- Python ProcessPoolExecutor (40)
- Python ThreadPool (52)
- Python ThreadPoolExecutor (71)
- Python Threading (79)
- Pages (5)
Concurrent File I/O (17)
- AIOFiles for AsyncIO in Python
- Concurrent File I/O 7-Day Course
- Concurrent File I/O Programming Patterns
- Faster File I/O With Concurrency
- How to Speed-up File IO with Concurrency in Python
- Multithreaded File Appending in Python
- Multithreaded File Copying in Python
- Multithreaded File Deletion in Python
- Multithreaded File Loading in Python
- Multithreaded File Moving in Python
- Multithreaded File Renaming in Python
- Multithreaded File Saving in Python
- Multithreaded File Unzipping in Python
- Multithreaded File Zipping in Python
- Python Concurrency: A Whirlwind Tour
- Python File IO: A Whirlwind Tour
- Run One-Off File I/O Tasks in the Background
Concurrent NumPy (42)
- 9 Ways to Share a Numpy Array Between Processes
- Check BLAS Library Installed For NumPy
- Combine NumPy BLAS Threads and Multiprocessing
- Concurrent NumPy 7-Day Course
- Configure the Number of BLAS/LAPACK Threads for NumPy
- Fastest Way To Share NumPy Array Between Processes
- How to Install BLAS Libraries for NumPy
- How to Share Numpy Array Using SharedMemory
- How to Share a NumPy Array Via a Pipe
- Limit BLAS Threads in Numpy with threadpoolctl
- NumPy BLAS/LAPACK Libraries
- NumPy Multithreaded Element-Wise Matrix Arithmetic
- NumPy Parallel Matrix-Vector Multiplication
- NumPy Supports Multithreaded Parallelism
- NumPy vs the Global Interpreter Lock (GIL)
- Numpy Multithreaded Matrix Functions (up to 3x faster)
- Numpy Multithreaded Matrix Multiplication (up to 5x faster)
- Numpy Multithreaded Matrix Multiplication Scales With Size
- Numpy Multithreaded Matrix Solvers (up to 2x faster)
- Numpy Parallel Matrix Decompositions
- Numpy Parallel Random Numbers (up to 4x faster)
- Numpy Parallel Random Numbers with Multiprocessing (up to 28x slower)
- Numpy Parallel Vector Distance Calculation
- Parallel NumPy Vector Math with Multiprocessing
- Parallel NumPy Vector Math with Threads
- Parallel Numpy Array Fill (up to 3x faster)
- Parallel Numpy Matrix Math Functions
- Performance Cost of Naive Parallelism in NumPy
- Share NumPy Array Using Memory-Mapped File
- Share Numpy Array Between Processes Using Function Arguments and Return Values
- Share Numpy Array Between Processes Using Global Variable
- Share Numpy Array Between Processes Using a Queue
- Share Numpy Array Between Processes With Shared ctypes
- Share a Numpy Array Between Processes Backed By RawArray
- Share a Numpy Array Between Processes Using a Manager
- Speed-Up NumPy With Threads in Python (up to 3.41x faster)
- ThreadPoolExecutor Fill NumPy Array
- Using Multiprocessing With Numpy Results in Worse Performance
- Using Threads With Numpy Can Result in Worse Performance
- What is BLAS and LAPACK in NumPy
- Which NumPy Functions Are Multithreaded
- Why Numpy Parallelism is Important
Python Asyncio (174)
- 4 Ways to Suppress Asyncio CancelledError
- 5 Common Asyncio Errors in Python (and how to avoid them)
- 6 Reasons to Use Asyncio
- 7 Common Asyncio Exceptions and Warnings
- Async For Loop in Python
- Async Function in Python
- Async Lambda in Python
- Asynchronous Comprehensions in Python
- Asynchronous Context Managers in Python
- Asynchronous Generators in Python
- Asynchronous Iterators in Python
- Asynchronous Requests in Python
- Asyncio Barrier in Python
- Asyncio Cancel All Tasks If One Task Fails
- Asyncio Cancel Task Cancellation (Uncancel)
- Asyncio Cancel Task and Wait
- Asyncio CancelledError Can Be Consumed
- Asyncio Case Study: Check Website HTTP Status Concurrently
- Asyncio Chat Client and Server
- Asyncio Concurrent Tasks
- Asyncio Condition Variable in Python
- Asyncio Context Variables For Shared State
- Asyncio Coroutine Chaining
- Asyncio Coroutine Function and Coroutine Types
- Asyncio Coroutine Object Methods in Python
- Asyncio Coroutine-Safe in Python
- Asyncio Coroutines Faster Than Threads!?
- Asyncio Custom Awaitable With __await__()
- Asyncio Deadlocks in Python
- Asyncio Disappearing Task Bug
- Asyncio Dunder Methods (Magic Methods)
- Asyncio Echo Unix Socket Server
- Asyncio Event Loop Exception Handler
- Asyncio Event Loop in Separate Thread
- Asyncio Handle Control-C (SIGINT)
- Asyncio Hello World Tutorial in Python
- Asyncio Helper Libraries
- Asyncio I/O Libraries
- Asyncio Libraries For Software Development
- Asyncio LifoQueue in Python
- Asyncio Log CancelledError Exceptions
- Asyncio Log Exceptions
- Asyncio Log Long-Running Blocking Calls With aiodebug
- Asyncio Log Task Exceptions With Done Callback Function
- Asyncio Log To File
- Asyncio Logging Best Practices
- Asyncio Logging Without Blocking
- Asyncio Module Logging
- Asyncio Non-Blocking Logging With aiologger
- Asyncio Periodic Task
- Asyncio Port Scanner in Python
- Asyncio PriorityQueue in Python
- Asyncio Queue in Python
- Asyncio Race Conditions
- Asyncio Run Event Loop Forever
- Asyncio Run Multiple Concurrent Event Loops
- Asyncio Semaphore in Python
- Asyncio Server Client Callback Handler
- Asyncio Server Context Manager
- Asyncio Shield From Cancellation
- Asyncio Shield Main Coroutine From Cancellation
- Asyncio Socket Servers
- Asyncio Streams in Python
- Asyncio Subprocess With create_subprocess_exec()
- Asyncio Subprocess With create_subprocess_shell()
- Asyncio Subprocess in Python
- Asyncio Suspend Forever
- Asyncio TCP vs Unix Sockets
- Asyncio Task Cancellation Best Practices
- Asyncio Task CancelledError Propagation
- Asyncio Task Exception Was Never Retrieved
- Asyncio Task Life-Cycle
- Asyncio Task That Cancels Itself
- Asyncio Timeout Best Practices
- Asyncio WebSocket Clients
- Asyncio gather() Add Done Callback Function
- Asyncio gather() Cancel All Tasks if One Task Fails
- Asyncio gather() Exception in Task Does Not Cancel
- Asyncio gather() Handle Exceptions
- Asyncio gather() In The Background
- Asyncio gather() Limit Concurrency
- Asyncio gather() Return Values
- Asyncio gather() Timeout
- Asyncio gather() TypeError: unhashable type: 'list'
- Asyncio gather() vs wait() in Python
- Asyncio sleep() in Python
- Asyncio vs Threading in Python
- Asyncio wait_for() to Wait With a Timeout
- Configure, Suppress, and Log Asyncio Warnings
- Coroutines Are Faster To Start Than Threads in Python
- Coroutines Use Less Memory Than Threads in Python
- Daemon Asyncio Task in Python
- Develop an Asyncio Echo Client and Server
- Find Stuck and Long Running Tasks in Asyncio
- How to Cancel an Asyncio Task
- How to Check Asyncio Task Status
- How to Create Asyncio Tasks in Python
- How to Create Task in Done Callback
- How to Debug Asyncio
- How to Download a Webpage with Asyncio
- How to Execute Multiple Coroutines with asyncio.Runner
- How to Exit the Asyncio Event Loop
- How to Force an Asyncio Task to Cancel
- How to Get All Asyncio Tasks in Python
- How to Get Asyncio Task Results
- How to Get Return Value From Asyncio Coroutine
- How to Get and Set Asyncio Task Names
- How to Get the Asyncio Coroutine from a Task in Python
- How to Get the Asyncio Task for a Coroutine
- How to Get the Current Asyncio Task in Python
- How to Handle Asyncio Task Exceptions
- How to Kill All Asyncio Tasks
- How to Lint (Static Analysis) Asyncio Code
- How to Profile Asyncio Programs
- How to Profile Asyncio With line_profiler
- How to Run Asyncio Coroutine in the Background
- How to Run Blocking Tasks in Asyncio
- How to Run Coroutine From Thread
- How to Run a Coroutine After a Delay in Python
- How to Run a Follow-Up Task in Asyncio
- How to Run an Asyncio Coroutine in Python
- How to Run an Asyncio Program in Python
- How to Show Progress of Asyncio Tasks
- How to Shutdown Asyncio Server Safely
- How to Use Asyncio Task Done Callback Functions
- How to Use Asyncio as_completed() in Python
- How to Use Asyncio to_thread()
- How to Use Asyncio wait() in Python
- How to Use an Asyncio Event in Python
- How to Use asyncio.gather() in Python
- How to Use the "async def" Expression in Python
- How to Use the "async for" Expression in Python
- How to Use the "async with" Expression in Python
- How to Wait for All Background Asyncio Tasks in Python
- How to use Asyncio Mutex Locks
- How to use an Asyncio BoundedSemaphore
- How to use asyncio.TaskGroup
- InvalidStateError: Exception is not set
- InvalidStateError: Result is not set
- Log All Silent Exceptions in Asyncio
- Python Async Keywords
- Python Async Web Servers and Frameworks
- Python Asyncio Alternatives
- Python Asyncio Books
- Python Asyncio Database Drivers
- Python Asyncio HTTP Client Libraries
- Python Asyncio Libraries: 5 Places Where To Find Them
- Python Asyncio On Raspberry Pi
- Python Asyncio: The Complete Guide
- Run One-Off Coroutine Outside of Asyncio
- RuntimeError: cannot reuse already awaited coroutine
- RuntimeWarning: Coroutine Was Never Awaited
- RuntimeWarning: Enable tracemalloc to get the object allocation traceback
- SyntaxError: 'await' outside function
- Use asyncio.timeout_at() to Run Tasks With Deadlines
- Using a Threading Lock in Asyncio Results in a Deadlock
- What are the Two Asyncio APIs
- What is Async/Await in Python
- What is Asyncio Await in Python
- What is Asyncio in Python
- What is a Coroutine in Python
- What is an Asyncio Awaitable in Python
- What is an Asyncio Pending Task
- What is an Asyncio Task
- What is asyncio.sleep(0)
- What is the Asyncio Event Loop
- What is the Main Coroutine
- When Are Asyncio Tasks Canceled
- When Does Asyncio Switch Between Tasks
- Why Asyncio Task Never Runs and Completes
- Why Python Developers Hate Asyncio
- asyncio.timeout() To Wait and Cancel Tasks
- concurrent.futures.Future and asyncio.Future Not Compatible
- concurrent.futures.Future vs asyncio.Future
Python Benchmarking (49)
- 4 Ways to Benchmark Python Code
- 5 Ways to Measure Execution Time in Python
- Asyncio Benchmark Context Manager
- Asyncio Benchmark Decorator
- Asyncio Benchmark Helper Coroutine
- Benchmark Asyncio with loop.time()
- Benchmark Context Manager in Python
- Benchmark Decorator in Python
- Benchmark Fastest Mean of NumPy Array
- Benchmark Fastest Way To Calculate Sum of NumPy Arrays
- Benchmark Fastest Way To Copy NumPy Array
- Benchmark Fastest Way To Create NumPy Array
- Benchmark Fastest Way To Create NumPy Random Numbers
- Benchmark Fastest Way To Sort NumPy Arrays
- Benchmark Helper Function in Python
- Benchmark Python Program with time Unix Command
- Benchmark Python With benchmarkit
- Benchmark Python with richbench
- Benchmark Python with simple_benchmark
- Benchmark Python with time.monotonic()
- Benchmark Python with time.perf_counter()
- Benchmark Python with time.process_time()
- Benchmark Python with time.thread_time()
- Benchmark Python with time.time()
- Benchmark Python with timeit
- Benchmark Python with timeit.timeit()
- Benchmark Tasks in the ProcessPoolExecutor
- Benchmark timeit Command Line Interface
- How to Benchmark Tasks in the ThreadPoolExecutor
- How to Benchmark a Python Function
- How to Benchmark a Python Program
- How to Benchmark a Python Statement
- Importance of Python Execution Time Performance Benchmarking
- Microbenchmarking in Python
- Profile Python Programs
- Python Benchmark Comparison Metrics
- Python Benchmark Unit Test
- Python Benchmarking 7-Day Course
- Python Benchmarking Best Practices
- Python Benchmarking With perfplot
- Python Benchmarking With profilehooks
- Python Benchmarking With pyperf
- Python Benchmarking With pytest-benchmark
- Python Books on Execution Time Benchmarking
- Python time.time() vs time.perf_counter()
- Repeat Benchmarks to Get Stable Results
- Stopwatch Timer Class For Benchmarking
- Tips When Presenting Benchmark Results
- time.time() vs timeit in Python
Python Concurrency (3)
- Asynchronous Programming in Python
- Concurrent Programming in Python
- Python Concurrency API Documentation
Python Multiprocessing (89)
- 3 Multiprocessing Common Errors
- Add if __name__ == ‘__main__’ When Spawning Processes
- Automatically Start Processes in Python
- Configure Child Process in Python
- Daemon Process in Python
- Does a Child Process Stop a Python Program From Exiting
- Execute Task in Child Process With a Timeout
- Exit a Process with sys.exit() in Python
- Fix FileNotFoundError With Multiprocessing in Python
- Fix a Broken Mutex Lock When Terminating Child Processes
- Forking Processes is 20x Faster Than Spawning in Python
- Get All Child Processes in Python
- Get Parent Process in Python
- Get Process By Name in Python
- How to Change the Process Name in Python
- How to Execute a Task with a Delay in a Child Process in Python
- How to Extend the Process Class in Python
- How to Get the Process PID in Python
- How to Join a Process in Python
- How to Order Parallel Tasks in Python
- How to Query Process Status
- How to Restart a Process in Python
- How to Safely Stop a Process in Python
- How to Share Large Data Between Processes in Python
- How to Use 100% of All CPU Cores in Python
- How to Use SharedMemory in Python
- How to Use a Manager Namespace to Share Data with Processes
- How to Use the SharedMemoryManager in Python
- How to print() from a Child Process in Python
- How to use a ShareableList in Python
- Inheriting is 34x Faster Than Sending Data Between Processes in Python
- Instance Variables Are Not Shared Between Processes in Python
- Kill All Child Processes in Python
- Kill Process By PID in Python
- Kill a Process in Python
- Main Process in Python
- Main Thread of a Process in Python
- Multiprocessing Barrier in Python
- Multiprocessing Best Practices
- Multiprocessing Condition Variable in Python
- Multiprocessing Context in Python
- Multiprocessing Deadlock in Python
- Multiprocessing Event Object In Python
- Multiprocessing For-Loop in Python
- Multiprocessing Freeze Support in Python
- Multiprocessing Inherit Global Variables in Python
- Multiprocessing JoinableQueue on Python
- Multiprocessing Lock in Python
- Multiprocessing Logging in Python
- Multiprocessing Manager Example in Python
- Multiprocessing Manager Nested Proxy Objects
- Multiprocessing Manager Server Process and Threads
- Multiprocessing Manager Share Concurrency Primitives in Python
- Multiprocessing Manager Share Queue in Python
- Multiprocessing Manager With a Custom Class
- Multiprocessing Manager to Share an Object with Processes
- Multiprocessing Pipe in Python
- Multiprocessing Queue in Python
- Multiprocessing RLock in Python
- Multiprocessing Race Conditions in Python
- Multiprocessing Return Value From Process
- Multiprocessing Semaphore in Python
- Multiprocessing Shared ctypes in Python
- Multiprocessing SimpleQueue in Python
- Multiprocessing Start Methods
- Multiprocessing vs GIL in Python
- Number of CPUs in Python
- Orphaned Processes in Python
- Parallel Nested For-Loops in Python
- Parent Process vs Child Process in Python
- Performance May Not Scale with CPU Cores in Python
- Process Exit Codes in Python
- Process Life-Cycle in Python
- Process Utility Functions in Python
- Process-Safe Counter in Python
- Process-Safe in Python
- Processes Are About 40x Slower Than Threads in Python
- Python Multiprocessing: The Complete Guide
- Return Value From Child Process Without Changing The Target Function
- Run a Function in a Child Process
- Share Object Instance Attributes With Processes in Python
- Stop Main Process and Leave Child Processes Running in Python
- Thread vs Process in Python
- Threading vs Multiprocessing in Python
- Threads are 4x Faster at Sharing Data Than Processes in Python
- Threads in Processes with Python
- What is Multiprocessing Shared Memory
- What is a Multiprocessing Manager
- Why Not Always Use Processes in Python
Python Multiprocessing Pool (62)
- 5 Usage Patterns for the Multiprocessing Pool
- 7 Multiprocessing Pool Common Errors in Python
- Configure the Multiprocessing Pool Context
- Does the Multiprocessing Pool Stop Main From Exiting
- Get Multiprocessing Pool Worker Names in Python
- Get Multiprocessing Pool Worker PID in Python
- How to Configure Multiprocessing Pool.map() Chunksize
- How to Configure the Multiprocessing Pool in Python
- How to Share a Queue with a Multiprocessing Pool
- Join a Multiprocessing Pool in Python
- Kill All Tasks in the Multiprocessing Pool in Python
- Multiprocessing Pool AsyncResult in Python
- Multiprocessing Pool Best Practices in Python
- Multiprocessing Pool Callback Functions in Python
- Multiprocessing Pool Class in Python
- Multiprocessing Pool Context Manager
- Multiprocessing Pool Error Callback Functions in Python
- Multiprocessing Pool Example in Python
- Multiprocessing Pool Exception Handling in Python
- Multiprocessing Pool Follow-Up Tasks in Python
- Multiprocessing Pool Get First Result
- Multiprocessing Pool Get Result from Asynchronous Tasks
- Multiprocessing Pool Initializer in Python
- Multiprocessing Pool Life-Cycle in Python
- Multiprocessing Pool Logging From Worker Processes
- Multiprocessing Pool Max Tasks Per Child in Python
- Multiprocessing Pool Number of Workers in Python
- Multiprocessing Pool PEP and History
- Multiprocessing Pool Remaining Tasks
- Multiprocessing Pool Restarts Workers if Killed
- Multiprocessing Pool Share Global Variable With All Workers
- Multiprocessing Pool Show Progress in Python
- Multiprocessing Pool Stop All Tasks If One Task Fails in Python
- Multiprocessing Pool Wait For All Tasks To Finish in Python
- Multiprocessing Pool When Are Workers Started
- Multiprocessing Pool Worker PIDs in Python
- Multiprocessing Pool and the Global Interpreter Lock (GIL)
- Multiprocessing Pool apply() vs map() vs imap() vs starmap()
- Multiprocessing Pool map() Multiple Arguments
- Multiprocessing Pool vs Process in Python
- Multiprocessing Pool vs ProcessPoolExecutor in Python
- Multiprocessing Pool with Different Function Types
- Multiprocessing Pool.apply() in Python
- Multiprocessing Pool.apply_async() in Python
- Multiprocessing Pool.imap() in Python
- Multiprocessing Pool.imap_unordered() in Python
- Multiprocessing Pool.map() in Python
- Multiprocessing Pool.map_async() in Python
- Multiprocessing Pool.starmap() in Python
- Multiprocessing Pool.starmap_async() in Python
- Parallel For-Loop With a Multiprocessing Pool
- Process Pool Tasks Fail Silently
- Python Multiprocessing Pool: The Complete Guide
- Share a Multiprocessing Pool With Workers
- Shutdown the Multiprocessing Pool in Python
- Stop All Tasks in the Multiprocessing Pool in Python
- Thread Details in the Multiprocessing Pool
- Use a Barrier in the Process Pool
- Use a Condition Variable in the Multiprocessing Pool
- Use a Lock in the Multiprocessing Pool
- Use a Semaphore in the Multiprocessing Pool
- Use an Event in the Multiprocessing Pool
Python ProcessPoolExecutor (40)
- 6 Common Usage Patterns for the ProcessPoolExecutor
- 7 ProcessPoolExecutor Common Errors in Python
- Calculate Fibonacci Numbers Concurrently in Python
- Concurrent Monte Carlo Estimate of Pi in Python
- Configure Max Workers For The ProcessPoolExecutor
- Create Thumbnails Concurrently in Python (3x faster)
- Get Results As Tasks Are Completed With ProcessPoolExecutor in Python
- How Does The ProcessPoolExecutor Work in Python
- How To Retry Failed Tasks in the ProcessPoolExecutor in Python
- How To Stop Running Tasks in the ProcessPoolExecutor in Python
- How to Add a Callback to the ProcessPoolExecutor in Python
- How to Cancel Tasks in the ProcessPoolExecutor
- How to Check PIDs and Thread Names in the ProcessPoolExecutor
- How to Check if Numbers are Prime Concurrently in Python
- How to Check the Status of a Task in a ProcessPoolExecutor
- How to Get Results From The ProcessPoolExecutor in Python
- How to Handle Exceptions With The ProcessPoolExecutor in Python
- How to Initialize Worker Processes in the ProcessPoolExecutor
- How to Limit Pending Tasks In The ProcessPoolExecutor
- How to Report The Number of Remaining Tasks in the ProcessPoolExecutor