Commit b0ecae0
committed
python: improve resource.status with many drained ranks
Problem: The ResourceStatus class performs a couple unnecessary idset
set operations for each drain entry in the resource.status response
object. When there are many entries, these set operations perform a
lot of unnecesary work and slow down the _recalcultate() method.
Build the set of drained ranks in the loop (which should be fast),
and delay splitting the set into drained and draining after the loop.1 parent 0766987 commit b0ecae0
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
0 commit comments