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

storage: defer putBuffer release in all cases #109087

Merged

Conversation

nvanbenschoten
Copy link
Member

Minor cleanup.

This commit switches the remainder of the calls to putBuffer.release to be deferred, instead of being manually called at the end of their function. The comments mentioning that the defer was "measurably slower" were introduced in 4444618, which was before Go 1.14 optimized the performance of defer. Most of these, including the more performance-sensitive calls, were already switched over to use defer in fbe8852.

Epic: None
Release note: None

@nvanbenschoten nvanbenschoten requested a review from a team as a code owner August 20, 2023 02:29
@blathers-crl
Copy link

blathers-crl bot commented Aug 20, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for cleaning this up!

This commit switches the remainder of the calls to putBuffer.release to be
deferred, instead of being manually called at the end of their function. The
comments mentioning that the defer was "measurably slower" were introduced in
4444618, which was before Go 1.14 optimized the performance of defer. Most of
these, including the more performance sensitive calls, were already switched
over to use defer in fbe8852.

Epic: None
Release note: None
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/putBufferDefer branch from 567ea44 to aa0a9cc Compare August 21, 2023 19:15
@nvanbenschoten
Copy link
Member Author

TFTR!

bors r+

@craig craig bot merged commit 604a90a into cockroachdb:master Aug 21, 2023
@craig
Copy link
Contributor

craig bot commented Aug 21, 2023

Build succeeded:

@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/putBufferDefer branch August 22, 2023 02:55
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.

3 participants