mirror of
https://github.com/wassname/ray.git
synced 2026-07-29 11:26:04 +08:00
Optimize python task execution (#6024)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user