Skip to content

storage: use new pebble.CloneOptions when cloning iterators#82981

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:pebble-iter-clone-options
Jul 12, 2022
Merged

storage: use new pebble.CloneOptions when cloning iterators#82981
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:pebble-iter-clone-options

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker commented Jun 16, 2022

This patch avoids first cloning and then reconfiguring the cloned
iterator, by constructing the clone with the correct settings in the
first place.

This shows a slight improvement on MVCCGet benchmarks that were
modified to always use cloned iterators. This would also happen
normally in many cases (e.g. when using an intent interleaving iterator
with a raw Engine, or when constructing a time-bound iterator which
requires two iterators from the underlying reader).

MVCCGet_Pebble/batch=false/versions=1/valueSize=8-24      4.87µs ± 3%    4.82µs ± 2%    ~     (p=0.101 n=10+10)
MVCCGet_Pebble/batch=false/versions=10/valueSize=8-24     5.88µs ± 1%    5.83µs ± 0%  -0.94%  (p=0.004 n=10+9)
MVCCGet_Pebble/batch=false/versions=100/valueSize=8-24    13.7µs ± 6%    13.7µs ± 4%    ~     (p=0.971 n=10+10)
MVCCGet_Pebble/batch=true/versions=1/valueSize=8-24       2.76µs ± 1%    2.76µs ± 1%    ~     (p=0.871 n=10+10)
MVCCGet_Pebble/batch=true/versions=10/valueSize=8-24      3.89µs ± 1%    3.86µs ± 2%  -0.76%  (p=0.011 n=10+10)
MVCCGet_Pebble/batch=true/versions=100/valueSize=8-24     10.2µs ± 3%    10.2µs ± 4%    ~     (p=0.912 n=10+10)

Release note: None

@erikgrinaker erikgrinaker requested a review from jbowens June 16, 2022 09:28
@erikgrinaker erikgrinaker self-assigned this Jun 16, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@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.

:lgtm:

the new CloneOptions (and the fix for the bug that you ran into when testing this previously) have landed on master.

Reviewed 2 of 5 files at r1, 2 of 3 files at r3, 1 of 1 files at r4.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker)

This patch avoids first cloning and then reconfiguring the cloned
iterator, by constructing the clone with the correct settings in the
first place.

This shows a slight improvement on `MVCCGet` benchmarks that were
modified to always use cloned iterators. This would also happen
normally in many cases (e.g. when using an intent interleaving iterator
with a raw `Engine`, or when constructing a time-bound iterator which
requires two iterators from the underlying reader).

```
MVCCGet_Pebble/batch=false/versions=1/valueSize=8-24      4.87µs ± 3%    4.82µs ± 2%    ~     (p=0.101 n=10+10)
MVCCGet_Pebble/batch=false/versions=10/valueSize=8-24     5.88µs ± 1%    5.83µs ± 0%  -0.94%  (p=0.004 n=10+9)
MVCCGet_Pebble/batch=false/versions=100/valueSize=8-24    13.7µs ± 6%    13.7µs ± 4%    ~     (p=0.971 n=10+10)
MVCCGet_Pebble/batch=true/versions=1/valueSize=8-24       2.76µs ± 1%    2.76µs ± 1%    ~     (p=0.871 n=10+10)
MVCCGet_Pebble/batch=true/versions=10/valueSize=8-24      3.89µs ± 1%    3.86µs ± 2%  -0.76%  (p=0.011 n=10+10)
MVCCGet_Pebble/batch=true/versions=100/valueSize=8-24     10.2µs ± 3%    10.2µs ± 4%    ~     (p=0.912 n=10+10)
```

Release note: None
@erikgrinaker erikgrinaker force-pushed the pebble-iter-clone-options branch from 437ccd2 to c58c0aa Compare July 11, 2022 21:57
@erikgrinaker erikgrinaker marked this pull request as ready for review July 11, 2022 21:59
@erikgrinaker erikgrinaker requested a review from a team as a code owner July 11, 2022 21:59
Copy link
Copy Markdown
Collaborator

@nicktrav nicktrav left a comment

Choose a reason for hiding this comment

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

:lgtm: :shipit:

Reviewed 7 of 7 files at r5, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @erikgrinaker)

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

TFTRs!

bors r=jbowens,nicktrav

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 12, 2022

Build succeeded:

@craig craig bot merged commit 93b1a61 into cockroachdb:master Jul 12, 2022
@erikgrinaker erikgrinaker deleted the pebble-iter-clone-options branch July 12, 2022 17:07
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.

4 participants