Call ray.put in ray.init() to speed up first object store access. (#5685)

This commit is contained in:
Robert Nishihara
2019-09-14 21:27:32 -07:00
committed by Philipp Moritz
parent 1560ace65a
commit 74a34b736d
+7
View File
@@ -2032,6 +2032,13 @@ def connect(node,
worker._set_object_store_client_options(
"ray_driver_{}".format(os.getpid()), driver_object_store_memory)
# Put something in the plasma store so that subsequent plasma store
# accesses will be faster. Currently the first access is always slow, and
# we don't want the user to experience this.
temporary_object_id = ray.ObjectID(np.random.bytes(20))
worker.put_object(temporary_object_id, 1)
ray.internal.free([temporary_object_id])
# Start the import thread
worker.import_thread = import_thread.ImportThread(worker, mode,
worker.threads_stopped)