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

membuffer: implement cache for ART #1470

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

you06
Copy link
Contributor

@you06 you06 commented Oct 3, 2024

ref pingcap/tidb#55287

ART can also benefit from the cache of last visited leaf, this PR implement the cache, it's almost same as RBT's implementation.

The test result of new added BenchmarkMemBufferCache:

// RBT, with cache, 1 cache-miss and 10 cache-hits for each key
BenchmarkMemBufferCache/RBT
BenchmarkMemBufferCache/RBT-32          10000000               185.9 ns/op             0 B/op          0 allocs/op

// master, no cache, 11 cache-miss for each key
BenchmarkMemBufferCache/ART
BenchmarkMemBufferCache/ART-32          10000000               223.3 ns/op             0 B/op          0 allocs/op

// this PR, with cache, 1 cache-miss and 10 cache-hits for each key
BenchmarkMemBufferCache/ART
BenchmarkMemBufferCache/ART-32          10000000               126.6 ns/op             0 B/op          0 allocs/op

Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2024
Signed-off-by: you06 <you1474600@gmail.com>
@you06 you06 changed the title membuffer: fix the bug that the cache statistics of ART is not correct membuffer: implement cache for ART Oct 8, 2024
@you06 you06 requested review from cfzjywxk and ekexium October 8, 2024 05:48
Copy link
Contributor

@ekexium ekexium left a comment

Choose a reason for hiding this comment

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

A benchmark result of its effect in TiDB's use case would be more convincing.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 8, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Oct 8, 2024
Copy link

ti-chi-bot bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, ekexium

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 8, 2024
Copy link

ti-chi-bot bot commented Oct 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-08 08:38:54.519176158 +0000 UTC m=+948889.939389154: ☑️ agreed by ekexium.
  • 2024-10-08 08:53:04.921955496 +0000 UTC m=+949740.342168508: ☑️ agreed by cfzjywxk.

@ti-chi-bot ti-chi-bot bot merged commit c3e10ae into tikv:master Oct 8, 2024
12 checks passed
@you06
Copy link
Contributor Author

you06 commented Oct 8, 2024

A benchmark result of its effect in TiDB's use case would be more convincing.

Little improvement, see TiDB's PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants