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

util/chunk: optimize (*ListInDisk).GetChunk and add a fast row container reader (#45130) #45203

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #45130

What problem does this PR solve?

Issue Number: close #45125

Problem Summary:

The existing reading method of RowContainer (GetChunk(...)) is not fast enough for dumping a lot of rows from disk (for the cursorFetch use case).

The existing Iterator4RowContainer is even slower, as it allocates a new chunk for each row 🤦.

This PR is extracted from #44730 (with a some refractor).

What is changed and how it works?

This PR pipelines the IO and CPU calculation, to make full use of the IO bandwidth. It should also help other features using rowContainer, as GetChunk is now much faster.

The performance of existing benchmark BenchmarkListInDisk_GetChunk increases from 2877471ns/op to 462864ns/op

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR. labels Jul 6, 2023
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 6, 2023
@YangKeao YangKeao requested review from xhebox and wshwsh12 July 10, 2023 05:52
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 10, 2023
@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 10, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiancaiamao, xhebox

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

ti-chi-bot bot commented Jul 10, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-07-10 06:05:59.920992605 +0000 UTC m=+312051.691331320: ☑️ agreed by xhebox.
  • 2023-07-10 06:09:13.129212613 +0000 UTC m=+312244.899551326: ☑️ agreed by tiancaiamao.

@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 10, 2023
@purelind
Copy link
Contributor

/test all

@tiprow
Copy link

tiprow bot commented Jul 10, 2023

@purelind: No presubmit jobs available for pingcap/tidb@release-7.1

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 merged commit aa4084e into pingcap:release-7.1 Jul 10, 2023
@Lloyd-Pottiger Lloyd-Pottiger deleted the cherry-pick-45130-to-release-7.1 branch July 17, 2023 05:21
@ti-chi-bot ti-chi-bot removed the cherry-pick-approved Cherry pick PR approved by release team. label Jul 24, 2023
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 24, 2023
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants