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: remove unnecessary copy in the baseCollector #51244

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Feb 22, 2024

What problem does this PR solve?

Issue Number: close #51246

Problem Summary:

What changed and how does it work?

baseCollector.FromProto will copy the bytes in the tipb.RowSampleCollector. it is unnecessary. After FromProto, it will not be used again.

BTW Someone said the protobuf have a problem to make statistics wrong if we remove this copy. so let us check it.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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 bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked do-not-merge/needs-linked-issue labels Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Merging #51244 (fe383c4) into master (9ee46d4) will decrease coverage by 15.9002%.
Report is 3 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51244         +/-   ##
=================================================
- Coverage   70.5917%   54.6915%   -15.9002%     
=================================================
  Files          1467       1577        +110     
  Lines        435011     602504     +167493     
=================================================
+ Hits         307082     329519      +22437     
- Misses       108658     250037     +141379     
- Partials      19271      22948       +3677     
Flag Coverage Δ
integration 36.8034% <100.0000%> (?)
unit 70.3379% <100.0000%> (-0.0528%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.3670% <ø> (+5.4790%) ⬆️

@hawkingrei
Copy link
Member Author

/retest

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

This copy is added since we met some strange problems when we introduced it.

Approve since we passed simple tests this time.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 22, 2024
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Please fill in your PR description. This then becomes a really valuable resource for the future to understand why certain changes have been made.
Also, please mention the worry that we talked about on the lark.
Thanks!

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 22, 2024
Copy link

ti-chi-bot bot commented Feb 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hi-rustin, winoros

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:

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 22, 2024
Copy link

ti-chi-bot bot commented Feb 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-22 10:09:43.413622365 +0000 UTC m=+524672.161245475: ☑️ agreed by winoros.
  • 2024-02-22 10:16:24.457935439 +0000 UTC m=+525073.205558549: ☑️ agreed by hi-rustin.

@hawkingrei
Copy link
Member Author

Please fill in your PR description. This then becomes a really valuable resource for the future to understand why certain changes have been made. Also, please mention the worry that we talked about on the lark. Thanks!

/hold

OK, I has updated all information.

@hawkingrei
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 22, 2024
@ti-chi-bot ti-chi-bot bot merged commit 8f2428e into pingcap:master Feb 22, 2024
23 checks passed
@hawkingrei hawkingrei deleted the rmeove_copy branch May 11, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove unnecessary copy in the baseCollector
3 participants