[ 
https://issues.apache.org/jira/browse/YUNIKORN-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wilfred Spiegelenburg resolved YUNIKORN-1764.
---------------------------------------------
    Fix Version/s: 1.3.0
       Resolution: Fixed

Smaller optimisation on top of YUNIKORN-1720 which was a major improvement.

> Don't copy resource object in Node.preAllocateCheck()
> -----------------------------------------------------
>
>                 Key: YUNIKORN-1764
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1764
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: core - scheduler
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.3.0
>
>         Attachments: screenshot-1.png
>
>
> The method {{Resource.Clone()}} shows up quite often in various heap profiles 
> which were captured on busy clusters (see screenshot).
> One of the call sites of this method is {{Node.preAllocateCheck()}} which 
> calls this method in the scheduling cycle very often:
> {noformat}
>       // check if resources are available
>       available := sn.GetAvailableResource()
>       // returns true/false based on if the request fits in what we have 
> calculated
>       return available.FitInMaxUndef(res)
> {noformat}
> {{GetAvailableResource()}} returns the copy of the underlying resource 
> object. However, cloning is not necessary. Two approaches are possible:
>  # since this code is inside the {{Node}} object, we can access 
> {{sn.availableResource}} without cloning by simply acquiring the read lock
>  # add a new method which receives a {{Resource}} object, then performs the 
> fit-no fit check without copying



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to