Optimize python task execution (#6024)

This commit is contained in:
Philipp Moritz
2019-10-27 00:43:34 -07:00
committed by GitHub
parent e706cb63cc
commit 80c01617a3
7 changed files with 60 additions and 40 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ cdef extern from "ray/core_worker/common.h" nogil:
CRayFunction(CLanguage language,
const c_vector[c_string] function_descriptor)
CLanguage GetLanguage()
c_vector[c_string] GetFunctionDescriptor()
const c_vector[c_string]& GetFunctionDescriptor()
cdef cppclass CTaskArg "ray::TaskArg":
@staticmethod
+7 -2
View File
@@ -35,8 +35,13 @@ cdef class ProfileEvent:
elif self.extra_data is not None:
extra_data = self.extra_data
self.inner.get().SetExtraData(
json.dumps(extra_data).encode("ascii") if extra_data else b"{}")
if not extra_data:
self.inner.get().SetExtraData(b"{}")
elif isinstance(extra_data, dict):
self.inner.get().SetExtraData(
json.dumps(extra_data).encode("ascii"))
else:
self.inner.get().SetExtraData(extra_data)
# Deleting the CProfileEvent will add it to a queue to be pushed to
# the driver.