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

Improve the performance of length and ascii functions #9345

Merged
merged 12 commits into from
Sep 3, 2024

Conversation

xzhangxian1008
Copy link
Contributor

@xzhangxian1008 xzhangxian1008 commented Aug 22, 2024

What problem does this PR solve?

Issue Number: close #9344

Problem Summary:

What is changed and how it works?

Benchmark from bench_function_string.cpp

           origin         optimized
length    19794917 ns    1824123 ns 985.2%
ascii     20572895 ns    2592171 ns 693.7%

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

None

@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 22, 2024
@xzhangxian1008
Copy link
Contributor Author

/cc @windtalker

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 22, 2024
@ti-chi-bot ti-chi-bot bot requested a review from windtalker August 22, 2024 11:16
@xzhangxian1008
Copy link
Contributor Author

/cc @windtalker @gengliqi

@ti-chi-bot ti-chi-bot bot requested a review from gengliqi August 23, 2024 05:43
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2024
@xzhangxian1008 xzhangxian1008 changed the title Improve the performance of length, ascii and position functions Improve the performance of length and ascii functions Aug 27, 2024
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/tests/gtest_strings_position.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 28, 2024
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsString.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 28, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 29, 2024
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. labels Sep 3, 2024
@ti-chi-bot ti-chi-bot bot merged commit b30c1f5 into pingcap:master Sep 3, 2024
5 checks passed
@xzhangxian1008 xzhangxian1008 deleted the improve-length-func branch September 3, 2024 03:07
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #9396.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #9397.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Sep 3, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.4: #9398.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Sep 3, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #9399.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Sep 3, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #9400.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Sep 3, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #9401.

ti-chi-bot bot pushed a commit that referenced this pull request Sep 6, 2024
)

close #9344

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>

Co-authored-by: xzhangxian1008 <xzhangxian@foxmail.com>
ti-chi-bot bot pushed a commit that referenced this pull request Sep 6, 2024
)

close #9344

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>

Co-authored-by: xzhangxian1008 <xzhangxian@foxmail.com>
Co-authored-by: JaySon <tshent@qq.com>
ti-chi-bot bot pushed a commit that referenced this pull request Sep 6, 2024
)

close #9344

Co-authored-by: xzhangxian1008 <xzhangxian@foxmail.com>
ti-chi-bot bot added a commit that referenced this pull request Sep 6, 2024
)

close #9344

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>

Co-authored-by: xzhangxian1008 <xzhangxian@foxmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this pull request Sep 6, 2024
)

close #9344

Co-authored-by: xzhangxian1008 <xzhangxian@foxmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The performance of length and ascii functions needs to be improved
4 participants