schedulers/balance_region: use heap to speedup select store for transferpeer
Open
good first issue
type/enhancement
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Enhancement Task
In the function `transaferPeer`, we order all stores by region_score `asc` first, and try it one by one to find the right store. However, maybe us a `heap` may make it more efficient
[https://github.com/tikv/pd/blob/c8775b6176a03eb25cb1622fc46ba1d496872df7/server/schedulers/balance_region.go#L226-L230](https://github.com/tikv/pd/blob/c8775b6176a03eb25cb1622fc46ba1d496872df7/server/schedulers/balance_region.go#L226-L230)
Contributor guide
Assessment
This issue has not been assessed yet.