craigcondit commented on code in PR #935:
URL: https://github.com/apache/yunikorn-core/pull/935#discussion_r1729216299
##########
pkg/scheduler/objects/sorters.go:
##########
@@ -65,8 +65,10 @@ func sortQueuesByPriorityAndFairness(queues []*Queue) {
if lPriority < rPriority {
return false
}
- comp :=
resources.CompUsageRatioSeparately(l.GetAllocatedResource(),
l.GetGuaranteedResource(),
- r.GetAllocatedResource(), r.GetGuaranteedResource())
+
Review Comment:
This is better, but to Wilfred's point from the community meeting, check out
the callers of `queue.sortQueues()` -- the are in queue.go under
`GetQueueOutstandingRequests()`, `TryAllocate()`, `TryPlaceholderAllocate()`
and `TryReservedAllocate()`. Each computes `queue.getHeadRoom()` at the start
which is used for further processing. Since these methods are all recursive
from the root queue down, you can compute the parent values at each step and
then pass the results into the `sortQueues()` function. This avoids having to
recompute all the parent queue values during sorting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]