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

executor: improve UnionScanRead performance #32668

Merged
merged 11 commits into from Apr 1, 2022

Conversation

Defined2014
Copy link
Contributor

@Defined2014 Defined2014 commented Feb 28, 2022

What problem does this PR solve?

Issue Number: ref #32433

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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

improve UnionScan performance

performance result

init
BenchmarkUnionScanRead-8   	     100	  10660929 ns/op	 6959025 B/op	  129133 allocs/op

global rows + encodeOldDatum
BenchmarkUnionScanRead-8   	     128	   9252419 ns/op	 2477990 B/op	   73130 allocs/op

add DecodeColumnValueWithDatum (if inline DecodeColumnValue will reach to 140)
BenchmarkUnionScanRead-8   	     134	   8870363 ns/op	 2477740 B/op	   73130 allocs/op

add m.offsets
BenchmarkUnionScanRead-8   	     146	   8143259 ns/op	 2477456 B/op	   73130 allocs/op

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 28, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tiancaiamao
  • xhebox

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 28, 2022
@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 28, 2022
@Defined2014 Defined2014 changed the title executor: reuse slice in memTableReader [WIP] executor: reuse slice in memTableReader Feb 28, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 28, 2022
@ti-chi-bot ti-chi-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 Mar 1, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Mar 1, 2022

@Defined2014 Defined2014 changed the title [WIP] executor: reuse slice in memTableReader [WIP] executor: improve UnionScanRead performance Mar 1, 2022
@Defined2014 Defined2014 changed the title [WIP] executor: improve UnionScanRead performance executor: improve UnionScanRead performance Mar 1, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 1, 2022
@Defined2014
Copy link
Contributor Author

/cc @tiancaiamao
PTAL.

executor/mem_reader.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tiancaiamao tiancaiamao left a comment

Choose a reason for hiding this comment

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

The encoding/decoding code here is still not good enough...
If I get a time, I'd rather rewrite it totally.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 30, 2022
@Defined2014 Defined2014 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 30, 2022
@Defined2014
Copy link
Contributor Author

/cc @xhebox @bb7133
PTAL

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 31, 2022
@xhebox
Copy link
Contributor

xhebox commented Mar 31, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 92b1764

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 31, 2022
@Defined2014
Copy link
Contributor Author

/run-unit-test

@Defined2014
Copy link
Contributor Author

/run-mysql-test

@Defined2014 Defined2014 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 1, 2022
@ti-chi-bot ti-chi-bot merged commit 17a9fc4 into pingcap:master Apr 1, 2022
@Defined2014 Defined2014 deleted the 32433 branch April 1, 2022 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants