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

statistics: improve memory for mergeGlobalStatsTopNByConcurrency (#45993) #46057

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #45993

What problem does this PR solve?

Issue Number: close #45727

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
goos: linux
goarch: amd64
pkg: github.com/pingcap/tidb/statistics
cpu: AMD Ryzen 7 7735HS with Radeon Graphics
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size100-16         	   16852	     82494 ns/op	   19801 B/op	     248 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size1000-16        	    2394	    528919 ns/op	  164952 B/op	    2048 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size10000-16       	      46	  27104549 ns/op	16254536 B/op	  200239 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size100000-16      	       1	3820741278 ns/op	1564350080 B/op	19552007 allocs/op

after

goos: linux
goarch: amd64
pkg: github.com/pingcap/tidb/statistics
cpu: AMD Ryzen 7 7735HS with Radeon Graphics
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size100-16         	   25230	     54848 ns/op	    6234 B/op	      48 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size1000-16        	    5294	    209518 ns/op	   35425 B/op	      48 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size10000-16       	     128	   9095930 ns/op	  350648 B/op	     203 allocs/op
BenchmarkMergeGlobalStatsTopNByConcurrencyWithHists/Size100000-16      	       1	1199193921 ns/op	 3448576 B/op	    1617 allocs/op
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Aug 14, 2023
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Aug 14, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/cherry-pick-not-approved size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 14, 2023
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei hawkingrei force-pushed the cherry-pick-45993-to-release-6.5 branch from f12af49 to a80cb8d Compare August 14, 2023 08:22
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 14, 2023
@hawkingrei
Copy link
Member

/test all

@tiprow
Copy link

tiprow bot commented Aug 14, 2023

@hawkingrei: No presubmit jobs available for pingcap/[email protected]

In response to this:

/test all

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 14, 2023
@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 14, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hi-rustin, time-and-fate

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [hi-rustin,time-and-fate]

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 ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 14, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 14, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-14 08:29:09.24249794 +0000 UTC m=+533313.791513926: ☑️ agreed by time-and-fate.
  • 2023-08-14 08:41:16.424674092 +0000 UTC m=+534040.973690064: ☑️ agreed by hi-rustin.

@hawkingrei
Copy link
Member

/retest

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (release-6.5@266b833). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-6.5     #46057   +/-   ##
================================================
  Coverage               ?   73.7198%           
================================================
  Files                  ?       1083           
  Lines                  ?     347517           
  Branches               ?          0           
================================================
  Hits                   ?     256189           
  Misses                 ?      74927           
  Partials               ?      16401           

@hawkingrei
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit 95aa0ca into pingcap:release-6.5 Aug 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants