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

optimization: using mashal to replace proto clone #5480

Merged
merged 16 commits into from
Sep 19, 2022

Conversation

bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Sep 8, 2022

Signed-off-by: bufferflies [email protected]

What problem does this PR solve?

Issue Number: Close #5477

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test

benchmark
image

Code changes

Side effects

Related changes

Release note

 None.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 8, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

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 the release-note-none Denotes a PR that doesn't merit a release note. label Sep 8, 2022
@bufferflies
Copy link
Contributor Author

some discuss about generics create link: golang/go#52151

@rleungx
Copy link
Member

rleungx commented Sep 8, 2022

Would you like to add a benchmark to compare these two methods?

Signed-off-by: bufferflies <[email protected]>
@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Base: 75.58% // Head: 75.64% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (5dd99ae) compared to base (d269010).
Patch coverage: 92.59% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5480      +/-   ##
==========================================
+ Coverage   75.58%   75.64%   +0.06%     
==========================================
  Files         323      325       +2     
  Lines       32000    32017      +17     
==========================================
+ Hits        24186    24220      +34     
+ Misses       5726     5708      -18     
- Partials     2088     2089       +1     
Flag Coverage Δ
unittests 75.64% <92.59%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
pkg/typeutil/clone.go 70.00% <70.00%> (ø)
pkg/mock/mockcluster/mockcluster.go 94.17% <75.00%> (ø)
pkg/encryption/region_crypter.go 67.92% <100.00%> (ø)
server/cluster/cluster.go 82.64% <100.00%> (-0.54%) ⬇️
server/cluster/cluster_worker.go 70.00% <100.00%> (ø)
server/core/factory.go 100.00% <100.00%> (ø)
server/core/region.go 91.28% <100.00%> (ø)
server/core/store.go 82.18% <100.00%> (-0.26%) ⬇️
server/core/store_option.go 100.00% <100.00%> (ø)
server/schedule/filter/filters.go 91.81% <100.00%> (ø)
... and 27 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: bufferflies <[email protected]>
@bufferflies
Copy link
Contributor Author

DeepClone Flame
image

ProtoClone Flame
image

pkg/typeutil/clone.go Outdated Show resolved Hide resolved
Signed-off-by: bufferflies <[email protected]>
pkg/typeutil/clone_test.go Outdated Show resolved Hide resolved
pkg/typeutil/clone_test.go Outdated Show resolved Hide resolved
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
pkg/typeutil/clone.go Outdated Show resolved Hide resolved
@bufferflies bufferflies force-pushed the proto-clone branch 3 times, most recently from a04936a to da094d9 Compare September 15, 2022 09:54
server/core/region.go Outdated Show resolved Hide resolved
@bufferflies bufferflies force-pushed the proto-clone branch 2 times, most recently from 4999a36 to 9db407a Compare September 15, 2022 10:04
Signed-off-by: bufferflies <[email protected]>
Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM.

server/core/store.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 16, 2022
server/core/store_option.go Outdated Show resolved Hide resolved
server/core/store_test.go Outdated Show resolved Hide resolved
Signed-off-by: bufferflies <[email protected]>
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 16, 2022
Signed-off-by: bufferflies <[email protected]>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2022
@bufferflies
Copy link
Contributor Author

PTAL @nolouch again

@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 Sep 19, 2022
@nolouch
Copy link
Contributor

nolouch commented Sep 19, 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: 5dd99ae

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 19, 2022
@ti-chi-bot ti-chi-bot merged commit 1e1732c into tikv:master Sep 19, 2022
@bufferflies bufferflies deleted the proto-clone branch September 20, 2022 02:21
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.

optimization: using mashal to replace proto clone
4 participants