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

*: reduce call when comparing key #5628

Merged
merged 2 commits into from
Oct 27, 2022
Merged

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Oct 24, 2022

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

What problem does this PR solve?

Issue Number: Ref #5606.

What is changed and how does it work?

go test -benchmem -count 5 -run=^$ -bench ^BenchmarkLoadRegionsByVolume$ github.com/tikv/pd/server/storage

name                                       old time/op    new time/op    delta
LoadRegionsByVolume/input_size_10000-40      0.05ns ±13%    0.04ns ±25%     ~     (p=0.056 n=5+5)
LoadRegionsByVolume/input_size_100000-40     0.60ns ± 9%    0.47ns ± 6%  -21.15%  (p=0.008 n=5+5)
LoadRegionsByVolume/input_size_1000000-40     6.84s ± 3%     5.35s ± 6%  -21.84%  (p=0.008 n=5+5)

name                                       old alloc/op   new alloc/op   delta
LoadRegionsByVolume/input_size_10000-40       0.00B          0.00B          ~     (all equal)
LoadRegionsByVolume/input_size_100000-40      0.00B          0.00B          ~     (all equal)
LoadRegionsByVolume/input_size_1000000-40     934MB ± 0%     933MB ± 0%   -0.01%  (p=0.032 n=5+5)

name                                       old allocs/op  new allocs/op  delta
LoadRegionsByVolume/input_size_10000-40        0.00           0.00          ~     (all equal)
LoadRegionsByVolume/input_size_100000-40       0.00           0.00          ~     (all equal)
LoadRegionsByVolume/input_size_1000000-40     15.2M ± 0%     15.2M ± 0%     ~     (p=0.421 n=5+5)
go test -benchmem -count 5 -run=^$ -bench ^BenchmarkLoadRegionsByRandomMerge$ github.com/tikv/pd/server/storage

name                                        old time/op    new time/op    delta
LoadRegionsByRandomMerge/merge_ratio_0-40      6.47s ± 6%     5.33s ± 5%  -17.62%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_20-40     7.99s ± 3%     7.01s ± 4%  -12.32%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_40-40     9.69s ± 5%     8.64s ± 4%  -10.86%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_60-40     11.1s ± 2%      9.9s ± 5%  -10.40%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_80-40     12.4s ± 3%     11.2s ± 5%   -9.74%  (p=0.008 n=5+5)

name                                        old alloc/op   new alloc/op   delta
LoadRegionsByRandomMerge/merge_ratio_0-40      934MB ± 0%     933MB ± 0%   -0.01%  (p=0.032 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_20-40    1.01GB ± 0%    1.01GB ± 0%     ~     (p=0.056 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_40-40    1.10GB ± 0%    1.10GB ± 0%   +0.06%  (p=0.032 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_60-40    1.17GB ± 0%    1.17GB ± 0%   +0.08%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_80-40    1.25GB ± 0%    1.25GB ± 0%   +0.09%  (p=0.016 n=5+5)

name                                        old allocs/op  new allocs/op  delta
LoadRegionsByRandomMerge/merge_ratio_0-40      15.2M ± 0%     15.2M ± 0%     ~     (p=0.151 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_20-40     18.0M ± 0%     18.0M ± 0%     ~     (p=0.421 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_40-40     20.7M ± 0%     20.7M ± 0%     ~     (p=0.151 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_60-40     23.3M ± 0%     23.3M ± 0%   +0.00%  (p=0.008 n=5+5)
LoadRegionsByRandomMerge/merge_ratio_80-40     25.8M ± 0%     25.8M ± 0%     ~     (p=0.151 n=5+5)

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • disksing

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 24, 2022
@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

Base: 75.71% // Head: 75.73% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (1445eca) compared to base (8e2bd59).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 1445eca differs from pull request most recent head cdba197. Consider uploading reports for the commit cdba197 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5628      +/-   ##
==========================================
+ Coverage   75.71%   75.73%   +0.01%     
==========================================
  Files         327      326       -1     
  Lines       32419    32387      -32     
==========================================
- Hits        24547    24529      -18     
+ Misses       5761     5752       -9     
+ Partials     2111     2106       -5     
Flag Coverage Δ
unittests 75.73% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/rangetree/range_tree.go 98.33% <100.00%> (+0.02%) ⬆️
server/core/region.go 91.86% <100.00%> (ø)
server/core/region_tree.go 94.16% <100.00%> (ø)
server/api/diagnostic.go 76.92% <0.00%> (-23.08%) ⬇️
pkg/metricutil/metricutil.go 82.75% <0.00%> (-6.90%) ⬇️
server/storage/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/cluster/diagnostic_manager.go 72.04% <0.00%> (-4.31%) ⬇️
server/core/peer.go 93.33% <0.00%> (-3.34%) ⬇️
server/region_syncer/server.go 82.96% <0.00%> (-3.30%) ⬇️
server/schedule/labeler/rules.go 87.50% <0.00%> (-2.28%) ⬇️
... and 26 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.

@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 Oct 24, 2022
@rleungx rleungx marked this pull request as ready for review October 24, 2022 10:32
@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 Oct 24, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 26, 2022
@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 Oct 27, 2022
@nolouch
Copy link
Contributor

nolouch commented Oct 27, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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: 1445eca

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 27, 2022
@ti-chi-bot ti-chi-bot merged commit d033fbf into tikv:master Oct 27, 2022
@rleungx rleungx deleted the reduce-call branch October 27, 2022 04:18
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