ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.25k stars 1.24k forks source link

Very slow with large number of contexts #420

Open alvaroaleman opened 2 months ago

alvaroaleman commented 2 months ago

Compared to the native kubectl config use-context $contextname, kubectl ctx is noticeable slower when operating on a kubeconfig with a large number of contexts (9.8k).

kubectx ctx needs around 1.3-1.4 seconds to switch a context versus the native kubectl config use-context needing 0.7-0.8s (n=3 for each, M1 Pro with Sonoma 14.4).

ahmetb commented 2 months ago

Is this the Go based implementation or the Bash based implementation?

alvaroaleman commented 2 months ago

It was the bash implementation, but the go implementation is only marginally faster, takes ~1.1 seconds