[GCU] Performance improvement by making patch sorting optional#2764
Merged
isabelmsft merged 4 commits intosonic-net:masterfrom Mar 31, 2023
Merged
[GCU] Performance improvement by making patch sorting optional#2764isabelmsft merged 4 commits intosonic-net:masterfrom
isabelmsft merged 4 commits intosonic-net:masterfrom
Conversation
f7a68e0 to
5dbd7bb
Compare
5dbd7bb to
6583b07
Compare
wen587
previously approved these changes
Mar 30, 2023
qiluo-msft
previously approved these changes
Mar 30, 2023
qiluo-msft
approved these changes
Mar 31, 2023
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
Make patch sorting optional.
Why: In some cases, patch sorting is unnecessary, as the patch doesn't have dependencies on other tables, and the patch is already in an order that can directly be applied to ConfigDB. A specific example is when GCU is used for YANG validation of direct writes to ConfigDB via
set_entryormod_entry. In these scenarios, we can directly apply each element in the JsonPatch without need for additional sortingThis allows for a performance improvement of ~40%.
Sample command to add portchannel including unnecessary patch sorting:
Sample command to add portchannel without unnecessary patch sorting:
How I did it
In ValidatedConfigDBConnector decorator code, set the sort=False flag, and read this value in GCU to determine whether patch sorting is necessary
How to verify it
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)