-
Notifications
You must be signed in to change notification settings - Fork 726
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
filter: replace region.Clone in filter (#2794) #2801
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
plz resolve the conflict. |
cd55702
to
cb7e407
Compare
Signed-off-by: Song Gao <disxiaofei@163.com>
f823d63
to
4c130de
Compare
Codecov Report
@@ Coverage Diff @@
## release-4.0 #2801 +/- ##
============================================
Coverage 77.46% 77.47%
============================================
Files 206 206
Lines 22652 22674 +22
============================================
+ Hits 17547 17566 +19
- Misses 3789 3790 +1
- Partials 1316 1318 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/run-all-tests |
cherry-pick #2794 to release-4.0
Signed-off-by: Song Gao disxiaofei@163.com
What problem does this PR solve?
ref #2783
region.Clone consumes too much cpu resources.
What is changed and how it works?
replace region.Clone with a self-maintained clone function as FitRegion only need partial information of a region.
BenchmarkCloneRegionTest is using new clone method and BenchmarkCloneRegionTest2 is using region.Clone
$ go test -bench=. -run=none goos: darwin goarch: amd64 pkg: github.com/tikv/pd/server/schedule/filter BenchmarkCloneRegionTest-4 4356267 267 ns/op BenchmarkCloneRegionTest2-4 316604 3292 ns/op PASS ok github.com/tikv/pd/server/schedule/filter 2.555s
Check List
Tests
Related changes
Release note