Skip to content

Commit

Permalink
Drop typing of self.idle
Browse files Browse the repository at this point in the history
As `self.idle` is actually a `SortedSet` instead of a `set`, we can't
type it. So revert changes related to `self.idle`. Though leave all
other `set`-based typing for other optimizations to be applied where
possible.
  • Loading branch information
jakirkham committed Dec 1, 2020
1 parent 6653b95 commit 3b30189
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4958,13 +4958,12 @@ def check_idle_saturated(self, ws, occ: double = -1.0):
total_occupancy: double = self.total_occupancy
avg: double = total_occupancy / total_nthreads

idle: set = self.idle
saturated: set = self.saturated
if p < nc or occ / nc < avg / 2:
idle.add(ws)
self.idle.add(ws)
saturated.discard(ws)
else:
idle.discard(ws)
self.idle.discard(ws)

pending: double = occ * (p - nc) / p / nc
if p > nc and pending > 0.4 and pending > 1.9 * avg:
Expand Down

0 comments on commit 3b30189

Please sign in to comment.