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

pkg: support generic for btree #5608

Merged
merged 6 commits into from
Nov 30, 2022
Merged

pkg: support generic for btree #5608

merged 6 commits into from
Nov 30, 2022

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Oct 18, 2022

Signed-off-by: Ryan Leung [email protected]

What problem does this PR solve?

Issue Number: Ref #5648 #5606.

What is changed and how does it work?

cd pkg/btree
go test -bench . -benchmem -count 5 > master/generic.txt
benchstat master.txt generic.txt
name                                 old time/op    new time/op    delta
Insert-8                                138ns ± 1%     106ns ± 0%   -23.06%  (p=0.008 n=5+5)
Seek-8                                  113ns ± 0%      74ns ± 1%   -34.79%  (p=0.008 n=5+5)
DeleteInsert-8                          294ns ± 1%     227ns ± 1%   -23.05%  (p=0.008 n=5+5)
DeleteInsertCloneOnce-8                 295ns ± 2%     228ns ± 1%   -22.85%  (p=0.008 n=5+5)
DeleteInsertCloneEachTime-8            1.18µs ± 1%    0.72µs ± 2%   -39.07%  (p=0.008 n=5+5)
Delete-8                                159ns ± 1%     120ns ± 1%   -24.72%  (p=0.008 n=5+5)
Get-8                                   104ns ± 1%      68ns ± 1%   -34.42%  (p=0.008 n=5+5)
GetCloneEachTime-8                      152ns ± 1%     114ns ± 1%   -25.00%  (p=0.008 n=5+5)
Ascend-8                               39.9µs ± 0%    31.1µs ± 0%   -21.98%  (p=0.008 n=5+5)
Descend-8                              38.9µs ± 1%    30.1µs ± 0%   -22.65%  (p=0.008 n=5+5)
AscendRange-8                          71.7µs ± 0%    49.8µs ± 0%   -30.57%  (p=0.008 n=5+5)
DescendRange-8                         93.0µs ± 0%    62.0µs ± 1%   -33.27%  (p=0.008 n=5+5)
AscendGreaterOrEqual-8                 52.3µs ± 1%    39.3µs ± 1%   -24.91%  (p=0.008 n=5+5)
DescendLessOrEqual-8                   74.5µs ± 0%    51.4µs ± 1%   -30.99%  (p=0.008 n=5+5)
DeleteAndRestore/CopyBigFreeList-8     4.87ms ± 0%    3.70ms ± 0%   -24.11%  (p=0.008 n=5+5)
DeleteAndRestore/Copy-8                4.99ms ± 0%    3.72ms ± 0%   -25.36%  (p=0.016 n=4+5)
DeleteAndRestore/ClearBigFreelist-8    2.45ms ± 0%    1.85ms ± 0%   -24.78%  (p=0.016 n=5+4)
DeleteAndRestore/Clear-8               2.58ms ± 2%    1.87ms ± 0%   -27.24%  (p=0.008 n=5+5)

name                                 old alloc/op   new alloc/op   delta
Insert-8                                37.0B ± 0%     19.0B ± 0%      ~     (p=0.079 n=4+5)
Seek-8                                  7.00B ± 0%     0.00B       -100.00%  (p=0.008 n=5+5)
DeleteInsert-8                          0.00B          0.00B           ~     (all equal)
DeleteInsertCloneOnce-8                 0.00B          0.00B           ~     (all equal)
DeleteInsertCloneEachTime-8            3.61kB ± 1%    2.53kB ± 1%   -29.94%  (p=0.008 n=5+5)
Delete-8                                0.00B          0.00B           ~     (all equal)
Get-8                                   0.00B          0.00B           ~     (all equal)
GetCloneEachTime-8                      48.0B ± 0%     48.0B ± 0%      ~     (all equal)
Ascend-8                                0.00B          0.00B           ~     (all equal)
Descend-8                               0.00B          0.00B           ~     (all equal)
AscendRange-8                           0.00B          0.00B           ~     (all equal)
DescendRange-8                          0.00B          0.00B           ~     (all equal)
AscendGreaterOrEqual-8                  0.00B          0.00B           ~     (all equal)
DescendLessOrEqual-8                    0.00B          0.00B           ~     (all equal)
DeleteAndRestore/CopyBigFreeList-8      275kB ± 0%     143kB ± 0%   -47.94%  (p=0.008 n=5+5)
DeleteAndRestore/Copy-8                 884kB ± 0%     466kB ± 0%   -47.30%  (p=0.008 n=5+5)
DeleteAndRestore/ClearBigFreelist-8    1.30kB ± 0%    0.86kB ± 0%   -33.38%  (p=0.008 n=5+5)
DeleteAndRestore/Clear-8                562kB ± 0%     299kB ± 0%   -46.82%  (p=0.008 n=5+5)

name                                 old allocs/op  new allocs/op  delta
Insert-8                                 0.00           0.00           ~     (all equal)
Seek-8                                   0.00           0.00           ~     (all equal)
DeleteInsert-8                           0.00           0.00           ~     (all equal)
DeleteInsertCloneOnce-8                  0.00           0.00           ~     (all equal)
DeleteInsertCloneEachTime-8              13.0 ± 0%      13.0 ± 0%      ~     (all equal)
Delete-8                                 0.00           0.00           ~     (all equal)
Get-8                                    0.00           0.00           ~     (all equal)
GetCloneEachTime-8                       3.00 ± 0%      3.00 ± 0%      ~     (all equal)
Ascend-8                                 0.00           0.00           ~     (all equal)
Descend-8                                0.00           0.00           ~     (all equal)
AscendRange-8                            0.00           0.00           ~     (all equal)
DescendRange-8                           0.00           0.00           ~     (all equal)
AscendGreaterOrEqual-8                   0.00           0.00           ~     (all equal)
DescendLessOrEqual-8                     0.00           0.00           ~     (all equal)
DeleteAndRestore/CopyBigFreeList-8       15.0 ± 0%      14.0 ± 0%    -6.67%  (p=0.008 n=5+5)
DeleteAndRestore/Copy-8                 1.19k ± 0%     1.19k ± 0%      ~     (all equal)
DeleteAndRestore/ClearBigFreelist-8      5.00 ± 0%      2.00 ± 0%   -60.00%  (p=0.008 n=5+5)
DeleteAndRestore/Clear-8                1.08k ± 0%     1.08k ± 0%    -0.09%  (p=0.008 n=5+5)

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 18, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • bufferflies

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Oct 18, 2022
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Base: 75.55% // Head: 75.67% // Increases project coverage by +0.12% 🎉

Coverage data is based on head (5cf7785) compared to base (0ac8782).
Patch coverage: 87.12% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5608      +/-   ##
==========================================
+ Coverage   75.55%   75.67%   +0.12%     
==========================================
  Files         330      330              
  Lines       32850    32887      +37     
==========================================
+ Hits        24820    24888      +68     
+ Misses       5871     5858      -13     
+ Partials     2159     2141      -18     
Flag Coverage Δ
unittests 75.67% <87.12%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/statistics/buckets/bucket_stat_informer.go 94.28% <ø> (ø)
server/statistics/buckets/hot_bucket_cache.go 90.09% <ø> (ø)
server/core/rangetree/range_tree.go 61.81% <36.84%> (ø)
pkg/btree/btree_generic.go 87.26% <87.61%> (ø)
pkg/cache/priority_queue.go 95.12% <88.88%> (ø)
server/cluster/unsafe_recovery_controller.go 78.96% <100.00%> (ø)
server/core/region.go 92.21% <100.00%> (ø)
server/core/region_tree.go 95.67% <100.00%> (+1.51%) ⬆️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 17, 2022
@rleungx rleungx marked this pull request as ready for review November 17, 2022 08:43
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 17, 2022
@@ -1,202 +0,0 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

We need keep LICENSE.

Copy link
Member Author

Choose a reason for hiding this comment

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

The LICENSE is contained in the go file.

Signed-off-by: Ryan Leung <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 29, 2022
Copy link
Member

@HunDunDM HunDunDM left a comment

Choose a reason for hiding this comment

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

need to delete pkg/rangetree?

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 30, 2022
@rleungx
Copy link
Member Author

rleungx commented Nov 30, 2022

need to delete pkg/rangetree?

Yes, it has already been deleted.

@rleungx
Copy link
Member Author

rleungx commented Nov 30, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2aefabc

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 30, 2022
@ti-chi-bot
Copy link
Member

@rleungx: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit 5d34111 into tikv:master Nov 30, 2022
@rleungx rleungx deleted the generic branch November 30, 2022 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants