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

Peter Bacsko updated YUNIKORN-1746:
-----------------------------------
    Description: 
Performance data (cpu and heap profiles) indicate that we can improve the 
performance of {{nodeInfoListerImpl.List()}}.

This is the code which is located in the shim:
{noformat}
func (n nodeInfoListerImpl) List() ([]*framework.NodeInfo, error) {
        nodes := n.cache.GetNodesInfoMap()
        nodeList := make([]*framework.NodeInfo, 0, len(nodes))
        for _, node := range nodes {
                nodeList = append(nodeList, node)
        }

        return nodeList, nil
}
{noformat}

We're supposed to be having a read lock on the cache, which is done outside 
this method. 

The problem is, the nodes info map only changes if a node joins or leaves the 
cluster. A lot of copying is done here, we generate a lot of waste. This method 
is called very frequently, because predicates need this list and predicates 
always run for each pod by default.

  was:
Performance data (cpu and heap profiles) indicates that we can improve the 
performance of {{nodeInfoListerImpl.List()}}.

This is the code which is located in the shim:
{noformat}
func (n nodeInfoListerImpl) List() ([]*framework.NodeInfo, error) {
        nodes := n.cache.GetNodesInfoMap()
        nodeList := make([]*framework.NodeInfo, 0, len(nodes))
        for _, node := range nodes {
                nodeList = append(nodeList, node)
        }

        return nodeList, nil
}
{noformat}

We're supposed to be having a read lock on the cache, which is done outside 
this method. 

The problem is, the nodes info map only changes if a node joins or leaves the 
cluster. A lot of copying is done here, we generate a lot of waste. This method 
is called very frequently, because predicates need this list and predicates 
always run for each pod by default.


> Improve the performance of nodeInfoListerImpl.List()
> ----------------------------------------------------
>
>                 Key: YUNIKORN-1746
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-1746
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>
> Performance data (cpu and heap profiles) indicate that we can improve the 
> performance of {{nodeInfoListerImpl.List()}}.
> This is the code which is located in the shim:
> {noformat}
> func (n nodeInfoListerImpl) List() ([]*framework.NodeInfo, error) {
>       nodes := n.cache.GetNodesInfoMap()
>       nodeList := make([]*framework.NodeInfo, 0, len(nodes))
>       for _, node := range nodes {
>               nodeList = append(nodeList, node)
>       }
>       return nodeList, nil
> }
> {noformat}
> We're supposed to be having a read lock on the cache, which is done outside 
> this method. 
> The problem is, the nodes info map only changes if a node joins or leaves the 
> cluster. A lot of copying is done here, we generate a lot of waste. This 
> method is called very frequently, because predicates need this list and 
> predicates always run for each pod by default.



--
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