You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "Dale Richardson (Jira)" <ji...@apache.org> on 2026/08/08 00:50:00 UTC

[jira] [Created] (YUNIKORN-3353) Keep only pending asks in sortedRequests

Dale Richardson created YUNIKORN-3353:
-----------------------------------------

             Summary: Keep only pending asks in sortedRequests
                 Key: YUNIKORN-3353
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3353
             Project: Apache YuniKorn
          Issue Type: Sub-task
          Components: core - scheduler
            Reporter: Dale Richardson
            Assignee: Dale Richardson


{{sortedRequests}} holds every ask an application has, allocated or not, so {{tryAllocate }}walks an ever growing prefix of already-allocated asks to reach the first one that can still be scheduled — skipping each with {{{}if request.IsAllocated() \{ continue }{}}}, and  {{IsAllocated}} takes a read lock per ask. In a CPU profile of master that skip is 18% of {{{}Application.tryAllocate{}}}.

Keep the slice pending-only instead: {{allocateAsk}} removes the ask, {{deallocateAsk}} puts it back.

The container and its insert algorithm are unchanged — {{sortedRequests}} was already a sorted slice with the same binary-search insert, and the reason it is a slice rather than a tree is documented in {{sorted_asks.go}} and still holds. *Only membership changes.*

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org