import time import numpy as np import ray ray.init(_node_ip_address='0.0.0.0') @ray.remote def f2(x): import time st = time.time() time.sleep(1) return st it_num = 100 st = time.time() result = ray.get([f2.remote(i) for i in range(it_num)]) print(result) print(max(result), min(result)) print(np.average(np.array(result) - st)) ray.shutdown()
Above is my code to test the time of dispatching tasks.
I ran code with
1, 10, 100
And I found avg result that
0.007524728775024414, 0.008671426773071289, 3.743643021583557.
It was rising too quickly from 10 to 100.
So I really wanted to know why this happened?
Pls tell me.
Ps, my laptop is macbook pro with 6-core i9
Thx a lot