I have written a python code with multi-processing. I did not see much of a performance improvement. I will share the code below. Please help me to understand if there is something missing?
if len(aspackets) != len(uepackets):
sys.exit("Packet number miss match between UE and AS")
else:
for i in range (1,100):
p = multiprocessing.Process(target=packet,args=(i,))
p.start()
#p.join()
E2E(packet(i),i)
Airinterface(packet(i))
core(packet(i))
switch(packet(i))
inet(packet(i))
bridge(packet(i))
The packet function is as
def packet(i):
return aspackets[i]
In my logic, I want to start the processing of multiple packets from a list of 100 packets. The processing of one packet does not affect the other packet. That is, it is okay to start my computation on packet 10 and 33 at the same time. In the normal flow(without multi-processing), I was going sequentiall from 1st to the last packet and had to wait for 45 mins to get the whole results.
I am running this code on Ubuntu machine which is running inside Virtual Box.
packet(i). Since this is done over aniterablei suggest you try to use PoolPooland correct your code accordingly.