mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 22:53:20 +08:00
[minor] Reduce perf overhead of object ref tracking (#6041)
This commit is contained in:
@@ -1048,11 +1048,11 @@ cdef class CoreWorker:
|
||||
def add_active_object_id(self, ObjectID object_id):
|
||||
cdef:
|
||||
CObjectID c_object_id = object_id.native()
|
||||
with nogil:
|
||||
self.core_worker.get().AddActiveObjectID(c_object_id)
|
||||
# Note: faster to not release GIL for short-running op.
|
||||
self.core_worker.get().AddActiveObjectID(c_object_id)
|
||||
|
||||
def remove_active_object_id(self, ObjectID object_id):
|
||||
cdef:
|
||||
CObjectID c_object_id = object_id.native()
|
||||
with nogil:
|
||||
self.core_worker.get().RemoveActiveObjectID(c_object_id)
|
||||
# Note: faster to not release GIL for short-running op.
|
||||
self.core_worker.get().RemoveActiveObjectID(c_object_id)
|
||||
|
||||
Reference in New Issue
Block a user