[Perf]Optimize waiting queue update with set usage (#20503)
This commit is contained in:
@@ -2284,9 +2284,8 @@ class Scheduler(
|
||||
if len(can_run_list) == 0:
|
||||
return None
|
||||
|
||||
self.waiting_queue = [
|
||||
x for x in self.waiting_queue if x not in set(can_run_list)
|
||||
]
|
||||
can_run_set = set(can_run_list)
|
||||
self.waiting_queue = [x for x in self.waiting_queue if x not in can_run_set]
|
||||
if adder.preempt_list:
|
||||
for req in adder.preempt_list:
|
||||
self._add_request_to_queue(req)
|
||||
|
||||
Reference in New Issue
Block a user