[minor] Reduce perf overhead of object ref tracking (#6041)

This commit is contained in:
Eric Liang
2019-10-29 18:14:51 -07:00
committed by GitHub
parent b89cac976a
commit 8ebba202df
4 changed files with 35 additions and 21 deletions
+4 -4
View File
@@ -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)