Skip to content

Update ports.go to update port list once for all ports instead of calling update port list for every port - #790

Open
gavinz-ship-it wants to merge 3 commits into
openconfig:mainfrom
gavinz-ship-it:main
Open

gavinz-ship-it wants to merge 3 commits into
openconfig:mainfrom
gavinz-ship-it:main

Conversation

@gavinz-ship-it

Copy link
Copy Markdown
Contributor

In the original code, each interface calls updatePortList once. This pull request reduce the number of calls to updatePortList so that it is called once for all prots.

In the original code, updatePortList perform linear number of operations. So CreatePorts performs quadratic number of operations.

In the new code, updatePortList is called only once so CreatePorts performs linear number of operations and 2 grpc call for updatePortList.

Avoid calling updatePortList repeatly for each port.
Update to call CreatePorts instead of CreatePort
@gavinz-ship-it
gavinz-ship-it requested a review from a team as a code owner November 7, 2026 02:48
@sonikajindal

Copy link
Copy Markdown
Contributor

/gcbrun

@gavinz-ship-it

Copy link
Copy Markdown
Contributor Author

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.

2 participants