-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-22.2: storage: avoid EncodeMVCCValue
struct comparison
#89236
Merged
erikgrinaker
merged 1 commit into
release-22.2
from
blathers/backport-release-22.2-88989
Oct 3, 2022
Merged
release-22.2: storage: avoid EncodeMVCCValue
struct comparison
#89236
erikgrinaker
merged 1 commit into
release-22.2
from
blathers/backport-release-22.2-88989
Oct 3, 2022
Conversation
This file contains 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
In Go 1.19, struct comparisons saw a significant performance regression, apparently due to the use of `memeqbody`. This patch changes `EncodeMVCCValue` to use field comparisons instead of struct comparisons, which yields a significant performance gain. Unfortunately, this prevents mid-stack inlining. However, the struct comparison regression is significantly larger than the inlining gains. We should reconsider this once Go 1.20 lands, where the regression has been fixed. ``` name old time/op new time/op delta EncodeMVCCValue/header=empty/value=tombstone-24 5.96ns ± 1% 4.66ns ± 0% -21.85% (p=0.000 n=9+9) EncodeMVCCValue/header=empty/value=short-24 5.93ns ± 0% 4.66ns ± 0% -21.40% (p=0.000 n=9+9) EncodeMVCCValue/header=empty/value=long-24 5.92ns ± 0% 4.66ns ± 0% -21.31% (p=0.000 n=10+10) EncodeMVCCValue/header=local_walltime/value=tombstone-24 51.9ns ± 1% 49.5ns ± 1% -4.81% (p=0.000 n=9+10) EncodeMVCCValue/header=local_walltime/value=short-24 54.2ns ± 1% 52.5ns ± 1% -3.25% (p=0.000 n=10+10) EncodeMVCCValue/header=local_walltime/value=long-24 1.34µs ± 2% 1.36µs ± 1% +1.69% (p=0.001 n=10+9) EncodeMVCCValue/header=local_walltime+logical/value=tombstone-24 56.3ns ± 0% 53.3ns ± 1% -5.40% (p=0.000 n=10+10) EncodeMVCCValue/header=local_walltime+logical/value=short-24 58.8ns ± 0% 56.3ns ± 2% -4.18% (p=0.000 n=10+9) EncodeMVCCValue/header=local_walltime+logical/value=long-24 1.36µs ± 3% 1.36µs ± 1% ~ (p=0.269 n=10+9) ``` Release note: None
blathers-crl
bot
force-pushed
the
blathers/backport-release-22.2-88989
branch
from
October 3, 2022 20:39
9286571
to
a29f3b0
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
blathers-crl
bot
requested review from
jbowens,
nicktrav,
nvanbenschoten and
a team
October 3, 2022 20:39
blathers-crl
bot
added
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
labels
Oct 3, 2022
jbowens
approved these changes
Oct 3, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
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.
Backport 1/1 commits from #88989 on behalf of @erikgrinaker.
/cc @cockroachdb/release
In Go 1.19, struct comparisons saw a significant performance regression, apparently due to the use of
memeqbody
. This patch changesEncodeMVCCValue
to use field comparisons instead of struct comparisons, which yields a significant performance gain.Unfortunately, this prevents mid-stack inlining. However, the struct comparison regression is significantly larger than the inlining gains. We should reconsider this once Go 1.20 lands, where the regression has been fixed.
Resolves #88818.
Release note: None
Release justification: fixes Go 1.19 performance regression.