Python Multiprocessing - Explanation for increase in time as the number of tasks increases -
i have simple function task. pass multiple arguments it.
def call_process(processes): pool = pool() results_1=pool.map(change_route_thread,processes) pool.close() pool.join()
if there 20,40,60 tasks in processes array , takes 0.1 seconds per task on average.
but if there 80 or 100 tasks in process array, takes 0.2 seconds per task on average.
why happen? want bring down time 80 or 100 tasks 0.1 seconds well.
i tried this:-
def call_process(processes): pool = pool() results_1=pool.map(change_route_thread,processes[0:60]) pool.close() pool.join() pool = pool() results_1=pool.map(change_route_thread,processes[60:]) pool.close() pool.join()
it gave me similar results. limitation on os?
exact statistics:-
tasks avg. time per task
10 0.107878417969
20 0.107998579025
40 0.11048762989
60 0.154217456818
80 0.234604523659
100 0.237693323135
Comments
Post a Comment