Skip to content

Instantly share code, notes, and snippets.

@igorcosta
Last active March 12, 2020 00:16
Show Gist options
  • Save igorcosta/a00a8a2f63b83c11683f98b3a6087cff to your computer and use it in GitHub Desktop.
Save igorcosta/a00a8a2f63b83c11683f98b3a6087cff to your computer and use it in GitHub Desktop.
Running 1 Billion func in Python3 with joblib
#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