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

client: don't construct transaction log string when it's not needed #342

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

dcbw
Copy link
Contributor

@dcbw dcbw commented Nov 1, 2022

fmt.Sprintf() will be evaluated before the logging function is called, which means that even if the logging level is less than V(4) we'll still construct the whole string for the operation, just to discard it. That can be pretty expensive.

Follow-up to #312

fmt.Sprintf() will be evaluated before the logging function is called,
which means that even if the logging level is less than V(4) we'll
still construct the whole string for the operation, just to discard
it. That can be pretty expensive.

Signed-off-by: Dan Williams <dcbw@redhat.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3370082401

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 74.936%

Files with Coverage Reduction New Missed Lines %
client/client.go 1 71.41%
Totals Coverage Status
Change from base Build 3369971146: -0.004%
Covered Lines: 4993
Relevant Lines: 6663

💛 - Coveralls

Copy link
Contributor

@flavio-fernandes flavio-fernandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@dcbw dcbw merged commit 8f21d18 into ovn-org:main Nov 1, 2022
dcbw added a commit to dcbw/ovn-kubernetes-1 that referenced this pull request Nov 14, 2022
…eeded

ovn-org/libovsdb#342

fmt.Sprintf() will be evaluated before the logging function is called,
which means that even if the logging level is less than V(4) we'll
still construct the whole string for the operation, just to discard
it. That can be pretty expensive.

Signed-off-by: Dan Williams <dcbw@redhat.com>
dcbw added a commit to dcbw/ovn-kubernetes-1 that referenced this pull request Nov 14, 2022
…eeded

ovn-org/libovsdb#342

fmt.Sprintf() will be evaluated before the logging function is called,
which means that even if the logging level is less than V(4) we'll
still construct the whole string for the operation, just to discard
it. That can be pretty expensive.

Signed-off-by: Dan Williams <dcbw@redhat.com>
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

3 participants