<p dir="auto">does not validate with swagger-tools CLI tool: <a href="https://github.com/apigee-127/swagger-tools/blob/master/docs/CLI.md#validate">https://github.com/apigee-127/swagger-tools/blob/master/docs/CLI.md#validate</a></p>
<p dir="auto">After <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120075385" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/18126" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/18126/hovercard" href="https://github.com/kubernetes/kubernetes/issues/18126">#18126</a> fixed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120272588" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/18170" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/18170/hovercard" href="https://github.com/kubernetes/kubernetes/pull/18170">#18170</a>, I run density test again.</p>
<p dir="auto">Now the hot spot on the critical path is an inefficient cache access(<a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/client/cache/store.go#L75">https://github.com/kubernetes/kubernetes/blob/master/pkg/client/cache/store.go#L75</a>) when listing nodes that uses reflection. Reflection causes a lot of allocations.</p>
<p dir="auto">A simple fix would be</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="func NodeKeyFunc(obj interface{}) (string, error) {
    key, ok := obj.(*api.Node)
    if !ok {
        return &quot;&quot;, fmt.Errorf(&quot;not *api.Node type&quot;)
    }
    meta := key.ObjectMeta
    if len(meta.Namespace) &gt; 0 {
        return meta.Namespace + &quot;/&quot; + meta.Name, nil
    }
    return meta.Name, nil
}"><pre class="notranslate"><span class="pl-k">func</span> <span class="pl-en">NodeKeyFunc</span>(<span class="pl-s1">obj</span> <span class="pl-k">interface</span>{}) (<span class="pl-smi">string</span>, <span class="pl-smi">error</span>) {
    <span class="pl-s1">key</span>, <span class="pl-s1">ok</span> <span class="pl-c1">:=</span> <span class="pl-s1">obj</span>.(<span class="pl-c1">*</span>api.<span class="pl-smi">Node</span>)
    <span class="pl-k">if</span> <span class="pl-c1">!</span><span class="pl-s1">ok</span> {
        <span class="pl-k">return</span> <span class="pl-s">""</span>, <span class="pl-s1">fmt</span>.<span class="pl-en">Errorf</span>(<span class="pl-s">"not *api.Node type"</span>)
    }
    <span class="pl-s1">meta</span> <span class="pl-c1">:=</span> <span class="pl-s1">key</span>.<span class="pl-c1">ObjectMeta</span>
    <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">meta</span>.<span class="pl-c1">Namespace</span>) <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span> {
        <span class="pl-k">return</span> <span class="pl-s1">meta</span>.<span class="pl-c1">Namespace</span> <span class="pl-c1">+</span> <span class="pl-s">"/"</span> <span class="pl-c1">+</span> <span class="pl-s1">meta</span>.<span class="pl-c1">Name</span>, <span class="pl-c1">nil</span>
    }
    <span class="pl-k">return</span> <span class="pl-s1">meta</span>.<span class="pl-c1">Name</span>, <span class="pl-c1">nil</span>
}</pre></div>
<p dir="auto">The simple fix improves the throughput of scheduler by 15%-20% on 1000 nodes case.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a> What do you think about this issue?</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hongchaodeng/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hongchaodeng">@hongchaodeng</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wojtek-t/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wojtek-t">@wojtek-t</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gmarek/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gmarek">@gmarek</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/davidopp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/davidopp">@davidopp</a></p>