Python Forum
fast_map (parallel/concurrent map) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: Code sharing (https://python-forum.io/forum-5.html)
+--- Thread: fast_map (parallel/concurrent map) (/thread-35725.html)



fast_map (parallel/concurrent map) - michalmonday - Dec-06-2021

I would like to share the "fast_map" package I wrote, and possibly ask for feedback. It uses multiple processes and threads to quickly complete IO and CPU expensive blocking tasks.
https://github.com/michalmonday/fast_map

Minimal example:
from fast_map import fast_map # pip3 install fast_map
import time

def io_and_cpu_expensive_function(x):
    time.sleep(1)
    for i in range(10 ** 6):
        pass
    return x*x

for i in fast_map(io_and_cpu_expensive_function, range(8)):
    print(i)