Skip to content

Commit

Permalink
imap for better memory management
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Meyer committed Feb 20, 2018
1 parent 7fa3563 commit 2130fec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trufflepig/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def apply_parallel(function, iterable, ncores, chunksize=1000):
ctx = mp.get_context('spawn')
pool = ctx.Pool(ncores)

results = [x for x in pool.map(function, iterable, chunksize)]
results = [x for x in pool.imap(function, iterable, chunksize)]

pool.close()
pool.join()
Expand Down

0 comments on commit 2130fec

Please sign in to comment.