-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Avoid expensive go-cmp/cmp comparison #104823
Conversation
The cmp comparison is relatively expensive (kubernetes#104821). If we're not going to log it, we shouldn't make the comparison.
/triage accepted |
/cc @MikeSpreitzer |
/lgtm /assign @smarterclayton Would you be willing to approve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
klog.V(4).Infof("%s writing Condition %s to FlowSchema %s, which had ResourceVersion=%s, because its previous value was %s, diff: %s", | ||
cfgCtlr.name, fsu.condition, fsu.flowSchema.Name, fsu.flowSchema.ResourceVersion, fcfmt.Fmt(fsu.oldValue), cmp.Diff(fsu.oldValue, fsu.condition)) | ||
if klog.V(4).Enabled() { | ||
klog.V(4).Infof("%s writing Condition %s to FlowSchema %s, which had ResourceVersion=%s, because its previous value was %s, diff: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .V(4)
is not needed here because it has already been tested, right?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb, MikeSpreitzer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The cmp comparison is relatively expensive (#104821). If we're not
going to log it, we shouldn't make the comparison.
/kind cleanup
Issue #104821