I added a progress bar to my 2.7 python code using tqdm but it has slowed down my code significantly. Without the progress bar for one example it takes 12 seconds while with the progress bar it takes 57 seconds.
The code without the progress bar looks like this:
p = mp.Pool()
combs = various combinations
result = p.map(self.parallelize, combs)
p.close()
p.join()
The code with the progress bar is as follows:
from tqdm import tqdm
p = mp.Pool()
combs = various combinations
result = list(tqdm(p.imap(self.parallelize, combs), total = 5000))
p.close()
p.join()
Is there a better way that wouldn't slow down my code as much?