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

FunctionsComparison: optimize the string_vector_constant when empty string constant #41870

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

jiebinn
Copy link
Contributor

@jiebinn jiebinn commented Sep 28, 2022

Changelog category (leave one):

  • Performance Improvement

Changelog entry:

Improve performance when comparing strings and one argument is empty constant string.

Add the fast path in string_vector_constant if the string constant is empty string. If the string size a_size and the string constant size b_size are both 0, they are equal and both empty string. And there is no need to call memequalSmallAllowOverflow15() for string comparison.

We have tested the patch on ICX 8380 x 2 server with ClickBench.

Query 5, 10, 12, 13, 14, 15, 18, 20, 21, 22, 24, 25, 26, 27, 29, 34 of Clickbench have gained 2%-6% improvement. The overall geomean has gained 1% improvement.

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-ch-test-poll robot-ch-test-poll added the pr-performance Pull request with some performance improvements label Sep 28, 2022
@jiebinn jiebinn changed the title FunctionsComparison: optimize the comparison with empty string FunctionsComparison: optimize the string_vector_constant when empty string Sep 28, 2022
@jiebinn jiebinn changed the title FunctionsComparison: optimize the string_vector_constant when empty string FunctionsComparison: optimize the string_vector_constant when empty string constant Sep 28, 2022
@kitaisreal kitaisreal self-assigned this Sep 28, 2022
@kitaisreal kitaisreal added the can be tested Allows running workflows for external contributors label Sep 28, 2022
jiebinn and others added 2 commits September 28, 2022 23:48
Add the fast path in string_vector_constant if the string constant
is empty string. If the string size a_size and the string constant
size b_size are both 0, they are equal and both empty string. And
there is no need to call memequalSmallAllowOverflow15() for string
comparison.

We have tested the patch on ICX 8380 x 2 server with ClickBench.

Query 5, 10, 12, 13, 14, 15, 18, 20, 21, 22, 24, 25, 26, 27, 29, 34
of Clickbench have gained 2%-6% improvement. The overall geomean has
gained 1% improvement.
@kitaisreal
Copy link
Collaborator

Tests failures are unrelated.

@kitaisreal kitaisreal merged commit f5a8aca into ClickHouse:master Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-performance Pull request with some performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants