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

colblk: check first timestamp before binary search #4015

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

RaduBerinde
Copy link
Member

This commit improves the code in the cockroach key seeker to first
check the latest timestamp (which will be the one we're looking for in
a majority of cases).

name                                                                                                                 old time/op    new time/op    delta
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/Next-10                 11.4ns ± 4%    11.2ns ± 1%    ~     (p=0.308 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGE-10                118ns ± 0%     118ns ± 0%  +0.24%  (p=0.023 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGELatest-10          109ns ± 0%     108ns ± 6%  -1.29%  (p=0.019 n=8+7)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/Next-10            10.6ns ± 0%    10.6ns ± 0%  -0.64%  (p=0.000 n=7+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGE-10          95.0ns ± 0%    92.2ns ± 0%  -2.94%  (p=0.000 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGELatest-10    88.2ns ± 0%    83.6ns ± 0%  -5.23%  (p=0.000 n=8+7)

This commit improves the code in the cockroach key seeker to first
check the latest timestamp (which will be the one we're looking for in
a majority of cases).

```
name                                                                                                                 old time/op    new time/op    delta
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/Next-10                 11.4ns ± 4%    11.2ns ± 1%    ~     (p=0.308 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGE-10                118ns ± 0%     118ns ± 0%  +0.24%  (p=0.023 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGELatest-10          109ns ± 0%     108ns ± 6%  -1.29%  (p=0.019 n=8+7)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/Next-10            10.6ns ± 0%    10.6ns ± 0%  -0.64%  (p=0.000 n=7+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGE-10          95.0ns ± 0%    92.2ns ± 0%  -2.94%  (p=0.000 n=8+8)
CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGELatest-10    88.2ns ± 0%    83.6ns ± 0%  -5.23%  (p=0.000 n=8+7)
````
@RaduBerinde RaduBerinde requested a review from a team as a code owner October 7, 2024 22:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaduBerinde)

@RaduBerinde
Copy link
Member Author

TFTR!

@RaduBerinde RaduBerinde merged commit b6df3e9 into cockroachdb:master Oct 8, 2024
12 checks passed
@RaduBerinde RaduBerinde deleted the cr-seek-check-first branch October 8, 2024 14:15
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