improve performance for show vlan brief in large-scale config#4626
Open
yanjundeng wants to merge 3 commits into
Open
improve performance for show vlan brief in large-scale config#4626yanjundeng wants to merge 3 commits into
yanjundeng wants to merge 3 commits into
Conversation
Signed-off-by: yanjun deng <yadeng@cisco.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: yanjun deng <yadeng@cisco.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
pbrisset
approved these changes
Jun 19, 2026
Signed-off-by: yanjun deng <yadeng@cisco.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Improve the performance of "show vlan brief" in large-scale testbed
How I did it
Performance issues in "show vlan brief":
Fix :
added _get_brief_cache(ctx) that precomputes ip_by_vlan, proxy_arp_by_vlan, ports_by_vlan (natsorted), tagging_by_vlan, naming mode, and the alias converter exactly once per command.
The cache is stashed on the db object (the same pattern the dhcp-relay plugin uses) — safe because click.make_pass_decorator(Db, ensure=True) creates a fresh Db per CLI invocation. InterfaceAliasConverter is only built when SONIC_CLI_IFACE_MODE=alias.
How to verify it
Verify it on Large scale setup.
It reduces the response time from 35s to 5s.
show-vlan-brief-improvement-ut.log
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)