I wrote this bit of code to test out Python's multiprocessing on my computer:
from multiprocessing import Pool var = range(5000000) def test_func(i): return i+1 if __name__ == '__main__': p = Pool() var = p.map(test_func, var) I timed this using Unix's time command and the results were:
real 0m2.914s user 0m4.705s sys 0m1.406s Then, using the same var and test_func() I timed:
var = map(test_func, var) and the results were
real 0m1.785s user 0m1.548s sys 0m0.214s Shouldn't the multiprocessing code be much faster than plain old map?