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

block: remove unnecessary CompressAndChecksum allocation #4091

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Oct 21, 2024

This allocation snuck in during the block package refactors.

                                                                                │   old.txt    │                new.txt                │
                                                                                │  allocs/op   │  allocs/op   vs base                  │
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=NoCompression-10    18.985k ± 0%   9.533k ± 0%  -49.79% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=Snappy-10           18.991k ± 0%   9.536k ± 0%  -49.79% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=ZSTD-10              66.29k ± 0%   56.84k ± 0%  -14.25% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=NoCompression-10   18.974k ± 0%   9.521k ± 0%  -49.82% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=Snappy-10          18.978k ± 0%   9.525k ± 0%  -49.81% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=ZSTD-10             66.27k ± 0%   56.83k ± 0%  -14.26% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=NoCompression-10      2.377k ± 0%   1.218k ± 0%  -48.76% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=Snappy-10             2.379k ± 0%   1.220k ± 0%  -48.72% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=ZSTD-10               8.184k ± 0%   7.024k ± 0%  -14.17% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=NoCompression-10     2.365k ± 0%   1.207k ± 0%  -48.96% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=Snappy-10            2.366k ± 0%   1.208k ± 0%  -48.95% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=ZSTD-10              8.172k ± 0%   7.011k ± 0%  -14.21% (p=0.000 n=10)

Fix #4090.

This allocation snuck in during the block package refactors.

```
                                                                                │   old.txt    │                new.txt                │
                                                                                │  allocs/op   │  allocs/op   vs base                  │
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=NoCompression-10    18.985k ± 0%   9.533k ± 0%  -49.79% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=Snappy-10           18.991k ± 0%   9.536k ± 0%  -49.79% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=true/compression=ZSTD-10              66.29k ± 0%   56.84k ± 0%  -14.25% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=NoCompression-10   18.974k ± 0%   9.521k ± 0%  -49.82% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=Snappy-10          18.978k ± 0%   9.525k ± 0%  -49.81% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=4.0KB/filter=false/compression=ZSTD-10             66.27k ± 0%   56.83k ± 0%  -14.26% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=NoCompression-10      2.377k ± 0%   1.218k ± 0%  -48.76% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=Snappy-10             2.379k ± 0%   1.220k ± 0%  -48.72% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=true/compression=ZSTD-10               8.184k ± 0%   7.024k ± 0%  -14.17% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=NoCompression-10     2.365k ± 0%   1.207k ± 0%  -48.96% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=Snappy-10            2.366k ± 0%   1.208k ± 0%  -48.95% (p=0.000 n=10)
Writer/format=(Pebble,v2)/block=32KB/filter=false/compression=ZSTD-10              8.172k ± 0%   7.011k ± 0%  -14.21% (p=0.000 n=10)
```

Fix cockroachdb#4090.
@jbowens jbowens requested a review from a team as a code owner October 21, 2024 21:53
@jbowens jbowens requested a review from itsbilal October 21, 2024 21:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @itsbilal)


-- commits line 11 at r1:
why does compression=ZSTD result in so many allocations???

Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @itsbilal)


-- commits line 11 at r1:

Previously, jbowens (Jackson Owens) wrote…

why does compression=ZSTD result in so many allocations???

#4092

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @itsbilal)

@jbowens jbowens merged commit 13f37fa into cockroachdb:master Oct 22, 2024
23 checks passed
@jbowens jbowens deleted the pballoc branch October 22, 2024 00:37
@jbowens
Copy link
Collaborator Author

jbowens commented Oct 22, 2024

TFTR!

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.

block: CompressAndChecksum allocation regression
3 participants