pd icon indicating copy to clipboard operation
pd copied to clipboard

server: optimize store topology weight memory

Open rleungx opened this issue 7 months ago • 2 comments

What problem does this PR solve?

Issue Number: Close #9288.

What is changed and how does it work?

$ benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: github.com/tikv/pd/server/cluster
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
                                   │   old.txt    │               new.txt               │
                                   │    sec/op    │    sec/op     vs base               │
BuildTopology/Small-10-Stores-72     7.234µ ± 10%   8.568µ ± 34%        ~ (p=0.240 n=6)
BuildTopology/Medium-100-Stores-72   53.34µ ±  9%   67.69µ ± 15%  +26.91% (p=0.004 n=6)
BuildTopology/Large-1000-Stores-72   396.2µ ±  3%   466.3µ ±  5%  +17.69% (p=0.002 n=6)
geomean                              53.47µ         64.67µ        +20.95%

                                   │    old.txt     │                  new.txt                  │
                                   │      B/op      │     B/op       vs base                    │
BuildTopology/Small-10-Stores-72       5.867Ki ± 0%   0.000Ki ±  0%  -100.00% (p=0.002 n=6)
BuildTopology/Medium-100-Stores-72   19208.000 ± 0%     2.000 ± 50%   -99.99% (p=0.002 n=6)
BuildTopology/Large-1000-Stores-72    91449.00 ± 0%     16.00 ± 12%   -99.98% (p=0.002 n=6)
geomean                                21.42Ki                       ?                      ¹ ²
¹ summaries must be >0 to compute geomean
² ratios must be >0 to compute geomean

                                   │   old.txt   │                 new.txt                 │
                                   │  allocs/op  │  allocs/op   vs base                    │
BuildTopology/Small-10-Stores-72      79.00 ± 0%     0.00 ± 0%  -100.00% (p=0.002 n=6)
BuildTopology/Medium-100-Stores-72    539.0 ± 0%      0.0 ± 0%  -100.00% (p=0.002 n=6)
BuildTopology/Large-1000-Stores-72   4.144k ± 0%   0.000k ± 0%  -100.00% (p=0.002 n=6)
geomean                               560.9                     ?                      ¹ ²
¹ summaries must be >0 to compute geomean
² ratios must be >0 to compute geomean

Check List

Tests

  • Unit test

Release note

None.

rleungx avatar May 07 '25 08:05 rleungx

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from rleungx, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar May 07 '25 08:05 ti-chi-bot[bot]

Codecov Report

:x: Patch coverage is 92.78351% with 7 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 76.05%. Comparing base (7c3b9a3) to head (a367c94). :warning: Report is 273 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9293      +/-   ##
==========================================
+ Coverage   75.96%   76.05%   +0.08%     
==========================================
  Files         472      472              
  Lines       73249    73333      +84     
==========================================
+ Hits        55646    55771     +125     
+ Misses      14131    14094      -37     
+ Partials     3472     3468       -4     
Flag Coverage Δ
unittests 76.05% <92.78%> (+0.08%) :arrow_up:

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

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 07 '25 08:05 codecov[bot]

@rleungx: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test-next-gen-1 a367c9410499edb34d5fa4c1628f4c02eaf2f646 link true /test pull-unit-test-next-gen-1
pull-unit-test-next-gen-2 a367c9410499edb34d5fa4c1628f4c02eaf2f646 link true /test pull-unit-test-next-gen-2
pull-unit-test-next-gen-3 a367c9410499edb34d5fa4c1628f4c02eaf2f646 link true /test pull-unit-test-next-gen-3

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

ti-chi-bot[bot] avatar Dec 04 '25 10:12 ti-chi-bot[bot]