Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize namespace lookups #237

Merged
merged 2 commits into from
Jul 1, 2024
Merged

optimize namespace lookups #237

merged 2 commits into from
Jul 1, 2024

Conversation

gsstuart
Copy link
Contributor

On clusters with a lot of namespaces (over 1,000), I've been noticing some lag when running kubie ns with no arguments.

It's currently performing a namespace lookup twice in this scenario: once with every call to namespace(), and then another one within select_or_list_namespace().

Since the first namespace lookup is only needed when a namespace argument is provided and validation is enabled, this PR moves the namespace lookup into that match arm. This has resulted in kubie ns running ~2x faster.

This should also address #208.

@sbstp
Copy link
Owner

sbstp commented Jul 1, 2024

Thanks

@sbstp sbstp merged commit 5e0431e into sbstp:master Jul 1, 2024
5 checks passed
@sbstp
Copy link
Owner

sbstp commented Jul 1, 2024

Will be included in 0.23.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants