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

mounter(ticdc): optimize mounter cpu usage by reduce memory allocation on map and slice #11081

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

3AceShowHand
Copy link
Contributor

@3AceShowHand 3AceShowHand commented May 13, 2024

What problem does this PR solve?

Issue Number: close #11210

What is changed and how it works?

  • use sync.Pool to reduce the map allocation for the datum
  • remove columnInfo slice from the datums2Column method, to reduce memory allocation.

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 13, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 13, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2024
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 92.15686% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 57.6113%. Comparing base (7fbae79) to head (57b01d9).
Report is 1 commits behind head on master.

Current head 57b01d9 differs from pull request most recent head f59703a

Please upload reports for the commit f59703a to get more accurate results.

Additional details and impacted files
Components Coverage Δ
cdc 61.4317% <92.1568%> (-0.0518%) ⬇️
dm 51.1638% <ø> (-0.0424%) ⬇️
engine 63.4020% <ø> (+0.0494%) ⬆️
Flag Coverage Δ
unit 57.6113% <92.1568%> (-0.0363%) ⬇️

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

@@               Coverage Diff                @@
##             master     #11081        +/-   ##
================================================
- Coverage   57.6475%   57.6113%   -0.0363%     
================================================
  Files           850        850                
  Lines        126040     126055        +15     
================================================
- Hits          72659      72622        -37     
- Misses        47985      48026        +41     
- Partials       5396       5407        +11     

@3AceShowHand 3AceShowHand changed the title [DNM] mounter(ticdc): optimize mounter cpu usage by reduce memory allocation on map and slice mounter(ticdc): optimize mounter cpu usage by reduce memory allocation on map and slice May 30, 2024
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 30, 2024
@CharlesCheung96
Copy link
Contributor

Please add the test result.

@3AceShowHand
Copy link
Contributor Author

Please add the test result.

The metrics is lost, since I use continous profiling which delete metrics data each 3 hours.

On the master branch, we can see obvious makemap called inside the decodedRowV2 method, and makeslice around 2.0% CPU usage inside the datum2Columns method.

In this PR, the makemap cannot be seen, and makeslice reduced to around 1.1%.

Copy link
Contributor

ti-chi-bot bot commented May 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CharlesCheung96

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

Copy link
Contributor

ti-chi-bot bot commented May 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-31 08:04:22.765480925 +0000 UTC m=+3022816.522616496: ☑️ agreed by CharlesCheung96.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mounter do not allocate memory for temporary column info slice
2 participants