Last active
March 12, 2020 00:16
-
-
Save igorcosta/a00a8a2f63b83c11683f98b3a6087cff to your computer and use it in GitHub Desktop.
Running 1 Billion func in Python3 with joblib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pip3 install joblib first | |
from joblib import Parallel, delayed | |
import time | |
start_time = time.time() | |
def BillionFuncJob(key): | |
time_of_running = time.time() - start_time | |
print('Hello Parallel {} with duration in secs {:03.2f}'.format(key, time_of_running)) | |
pass | |
Parallel(n_jobs=-1)(delayed(BillionFuncJob)(key) for key in range(1000000000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment