@@ -0,0 +1,1408 @@
+from __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0A%0Aimport ray%0A%0A%0Adef setup():%0A    if not hasattr(setup, %22is_initialized%22):%0A        ray.init(num_workers=10, num_cpus=10, resources=%7B%22foo%22: 1%7D)%0A        setup.is_initialized = True%0A%0A%0Adef square(x):%0A    return x * x%0A%0A%0Aclass TaskSuite(object):%0A    timeout = 10%0A%0A    def setup(self):%0A        self.square = ray.remote(square)%0A%0A    def run_many_tasks(self):%0A        ray.get(%5Bself.square.remote(i) for i in range(100)%5D)%0A%0A    def run_task_dependency(self):%0A        first_oid = self.square.remote(2)%0A        second_oid = self.square.remote(first_oid)%0A        ray.get(second_oid)%0A%0A    def time_submit_task(self):%0A        self.square.remote(2)%0A%0A    def time_task_lifecycle(self):%0A        ray.get(self.square.remote(2))%0A%0A    def peakmem_task_lifecycle(self):%0A        ray.get(self.square.remote(2))%0A%0A    def time_run_many_tasks(self):%0A        self.run_many_tasks()%0A%0A    def peakmem_run_many_tasks(self):%0A        self.run_many_tasks()%0A%0A    def time_task_dependency(self):%0A        self.run_task_dependency()%0A%0A    def peakmem_task_dependency(self):%0A        self.run_task_dependency()%0A%0A%0Aclass CPUTaskSuite(TaskSuite):%0A    def setup(self):%0A        self.square = ray.remote(num_cpus=1)(square)%0A%0A%0Aclass CustomResourceTaskSuite(TaskSuite):%0A    def setup(self):%0A        self.square = ray.remote(resources=%7B%22foo%22: 1%7D)(square)%0A

Add benchmarks for tasks (#2471)