You can fill a NumPy array in parallel using Python threads. NumPy will release the global interpreter lock (GIL) when calling a fill function, allowing Python worker threads in the ThreadPoolExecutor to run in parallel and populate different sub-arrays of a large shared array. This can offer up to a 3x speed-up when filling NumPy […]
Published on August 15, 2023 12:00