can anyone help me advising why I am getting slowness in Python Multiprocessing pool in windows platform on running below code:
with Pool(processes=6, initializer=init_pool,
initargs=(x, y, z)) as p:
res = pd.concat(p.imap(process_product, df.values))
It is taking 2-3 minutes in windows and on linux its taking less than a minute. Also, the CPU Utilisation is not going up just stand at 25% max only. Please let me know if the above code is fine to run on windows platform first.
I tried to put the logs in initpool methods as well. Its showing the process spawning as per below:
def init_pool(x, y, z):
print("initialising thread {} and current process {}".format(current_thread().name, current_process()))
global x1, y1, z1
x1 = x
y1 = y
z1 = z