Skip to content

Revert "Revert "Short circuit optimization for functions executed over Nullable arguments"" #73820

Merged
alexey-milovidov merged 7 commits intoClickHouse:masterfrom
bigo-sg:restore_short_circuit_func
Dec 26, 2024
Merged

Revert "Revert "Short circuit optimization for functions executed over Nullable arguments"" #73820
alexey-milovidov merged 7 commits intoClickHouse:masterfrom
bigo-sg:restore_short_circuit_func

Conversation

@taiyang-li
Copy link
Copy Markdown
Contributor

@taiyang-li taiyang-li commented Dec 25, 2024

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Revert "Revert "Short circuit optimization for functions executed over Nullable arguments"" . Add fast path for functions with all argument types is numeric. Fix performance issues in #72258

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

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

CI Settings (Only check the boxes if you know what you are doing)

All builds in Builds_1 and Builds_2 stages are always mandatory
and will run independently of the checks below:

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64
  • Exclude: All with release
  • Exclude: All with debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-performance Pull request with some performance improvements label Dec 25, 2024
@robot-ch-test-poll4
Copy link
Copy Markdown
Contributor

robot-ch-test-poll4 commented Dec 25, 2024

This is an automated comment for commit ae065b9 with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success

@taiyang-li
Copy link
Copy Markdown
Contributor Author

@Avogar @Algunenano I had added a fast path for functions with all argument type are numeric. And the performance tests show no obvious degradations.

@taiyang-li
Copy link
Copy Markdown
Contributor Author

taiyang-li commented Dec 26, 2024

slowdown: 1 2

speedup: 4

@alexey-milovidov alexey-milovidov added this pull request to the merge queue Dec 26, 2024
@alexey-milovidov alexey-milovidov self-assigned this Dec 26, 2024
Merged via the queue into ClickHouse:master with commit 6f43aca Dec 26, 2024
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 26, 2024
@cwurm
Copy link
Copy Markdown
Member

cwurm commented Jan 4, 2025

This change seems to cause logical errors, see #72265 for two examples found by the fuzzer.

I tested the build right before this PR (from #73813) and the build from this PR. Both reproduction examples work with one but not the other.

@taiyang-li
Copy link
Copy Markdown
Contributor Author

@cwurm I'll look into it next week.

@Algunenano
Copy link
Copy Markdown
Member

I still don't understand the motivation behind this PR. We are adding hundreds of lines of complex code but we don't see any performance improvement. The mentioned speedup looks unrelated as they are not even using Nullable arguments. Are you sure the change is actually improving anything?

Could you please create a performance test that verifies this change and shows a scenario where it's beneficial, please? Otherwise it's hard to justify keeping the extra complexity

@taiyang-li
Copy link
Copy Markdown
Contributor Author

taiyang-li commented Jan 8, 2025

I still don't understand the motivation behind this PR. We are adding hundreds of lines of complex code but we don't see any performance improvement. The mentioned speedup looks unrelated as they are not even using Nullable arguments. Are you sure the change is actually improving anything?

Could you please create a performance test that verifies this change and shows a scenario where it's beneficial, please? Otherwise it's hard to justify keeping the extra complexity

I'll add it in another pr later. Current performance tests don't cover the scenes in which this feature speeds up performance. You can refer to #60129 (comment) first. It is the most typical scene to prove its superiority.

@rschu1ze
Copy link
Copy Markdown
Member

rschu1ze commented Feb 9, 2025

I'll add it in another pr later.

Quick question: In which PR was the performance tests added?

@taiyang-li
Copy link
Copy Markdown
Contributor Author

@rschu1ze I'm going to add performance tests and comments in #73780 this week.

@taiyang-li
Copy link
Copy Markdown
Contributor Author

@rschu1ze updated: the changes had been moved to #76708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants