Skip to content

enginepb: use struct equality comparison in MVCCValueHeader.IsEmpty#111375

Merged
craig[bot] merged 1 commit into
cockroachdb:masterfrom
jbowens:isempty
Sep 27, 2023
Merged

enginepb: use struct equality comparison in MVCCValueHeader.IsEmpty#111375
craig[bot] merged 1 commit into
cockroachdb:masterfrom
jbowens:isempty

Conversation

@jbowens

@jbowens jbowens commented Sep 27, 2023

Copy link
Copy Markdown
Contributor

Now that we're on Go 1.20, the regression is gone.

goos: linux
goarch: amd64
cpu: Intel(R) Xeon(R) CPU @ 2.80GHz
                                                                 │   old.txt   │              new.txt               │
                                                                 │   sec/op    │   sec/op     vs base               │
EncodeMVCCValue/header=empty/value=tombstone-24                    4.797n ± 0%   4.809n ± 0%  +0.26% (p=0.000 n=10)
EncodeMVCCValue/header=empty/value=short-24                        4.796n ± 0%   4.809n ± 0%  +0.27% (p=0.000 n=10)
EncodeMVCCValue/header=empty/value=long-24                         4.797n ± 0%   4.809n ± 0%  +0.26% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime/value=tombstone-24           54.16n ± 1%   53.56n ± 0%  -1.10% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime/value=short-24               56.71n ± 1%   56.02n ± 1%  -1.22% (p=0.001 n=10)
EncodeMVCCValue/header=local_walltime/value=long-24                1.371µ ± 3%   1.314µ ± 1%  -4.16% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=long-24        1.346µ ± 2%   1.323µ ± 4%       ~ (p=0.160 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=tombstone-24   57.56n ± 2%   57.09n ± 1%  -0.83% (p=0.029 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=short-24       60.61n ± 1%   60.05n ± 1%  -0.92% (p=0.001 n=10)
geomean                                                            50.62n        50.10n       -1.02%

Epic: none
Resolves #89199.
Release note: None

…sEmpty

Now that we're on Go 1.20, the regression is gone.

```
goos: linux
goarch: amd64
cpu: Intel(R) Xeon(R) CPU @ 2.80GHz
                                                                 │   old.txt   │              new.txt               │
                                                                 │   sec/op    │   sec/op     vs base               │
EncodeMVCCValue/header=empty/value=tombstone-24                    4.797n ± 0%   4.809n ± 0%  +0.26% (p=0.000 n=10)
EncodeMVCCValue/header=empty/value=short-24                        4.796n ± 0%   4.809n ± 0%  +0.27% (p=0.000 n=10)
EncodeMVCCValue/header=empty/value=long-24                         4.797n ± 0%   4.809n ± 0%  +0.26% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime/value=tombstone-24           54.16n ± 1%   53.56n ± 0%  -1.10% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime/value=short-24               56.71n ± 1%   56.02n ± 1%  -1.22% (p=0.001 n=10)
EncodeMVCCValue/header=local_walltime/value=long-24                1.371µ ± 3%   1.314µ ± 1%  -4.16% (p=0.000 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=long-24        1.346µ ± 2%   1.323µ ± 4%       ~ (p=0.160 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=tombstone-24   57.56n ± 2%   57.09n ± 1%  -0.83% (p=0.029 n=10)
EncodeMVCCValue/header=local_walltime+logical/value=short-24       60.61n ± 1%   60.05n ± 1%  -0.92% (p=0.001 n=10)
geomean                                                            50.62n        50.10n       -1.02%
```

Epic: none
Resolves cockroachdb#89199.
Release note: None
@jbowens jbowens requested a review from a team as a code owner September 27, 2023 20:37
@jbowens jbowens requested a review from sumeerbhola September 27, 2023 20:37
@blathers-crl

blathers-crl Bot commented Sep 27, 2023

Copy link
Copy Markdown

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
Copy Markdown
Member

This change is Reviewable

@RaduBerinde RaduBerinde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)

@jbowens

jbowens commented Sep 27, 2023

Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=RaduBerinde

@craig

craig Bot commented Sep 27, 2023

Copy link
Copy Markdown
Contributor

Build succeeded:

@craig craig Bot merged commit fcd2f09 into cockroachdb:master Sep 27, 2023
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.

storage: reconsider struct comparisons with Go 1.20

3 participants