Skip to content

Run the ascii performance test queries with format Null - #131252

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-ascii-format-null
Nov 13, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-ascii-format-null

Conversation

@groeneai

@groeneai groeneai commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129258

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Description

From the #129258 audit: the 14 queries of ascii.xml (seven UTF-8 string functions, each on an ASCII and a non-ASCII constant, from numbers(10000000)) have 14-day master medians of 1.02-1.94 s on amd and 0.96-1.77 s on arm.

They are long because they have no format Null: perf.py receives all 10M rows (60-210 MB) in its Python client. On master CI the server spends 92-97% of each query's time waiting on the network send and 76-334 ms on CPU, so the test mostly measures the client's decoding, not the ASCII paths added in #61632 (whose own benchmarks used format Null).

No existing query number or text changes: 14 queries are disabled and 14 are appended. Queries 0-13 get disabled="1". The same 14 calls are appended as queries 14-27 with format Null, each on its own row count (20M-200M rows): per row, an ASCII call is up to 9 times cheaper than its non-ASCII pair, so one row count cannot keep them all between 0.2 and 0.75 s.

Measured locally with perf.py (official master release binary, 8 pinned cores, max_threads = 8, 3 old/new pass pairs) and scaled by each old query's CI/local server CPU ratio: queries 14-27 should take 0.20-0.48 s on amd and 0.24-0.52 s on arm, about 130 s amd and 110 s arm less per master perf job. Queries 0-13 did not run in any new pass (system.query_log). A three times slower function (lowerUTF8 nested three times) makes the old query 0.3% slower and the new one 2.8 times slower.

Queries 14-27 start a new history (CIDB has only 0-13 for this test). Both servers of a perf run use the PR's file, so this PR's perf report shows no "faster" verdict for this test.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/131252]

Version info

  • Merged into: 26.11.1.2191-master (included in 26.11 and later)

The 14 queries of tests/performance/ascii.xml return 10M rows to perf.py's
Python client. On master CI they take 1.0-1.9 s each, and the server spends
82-96% of that time waiting on the network send, with only 75-309 ms of CPU,
so the test mostly measures clickhouse-driver decoding rather than the
ASCII fast paths of the UTF-8 string functions that ClickHouse#61632 added.

Mark the 14 queries disabled (their text and numbers are unchanged) and
append the same 14 calls with format Null as queries 14-27. The row count of
each copy is picked from a 10M..1000M ladder so that its projected CI median
is in 0.2-0.75 s on amd and arm (local server CPU scaled by the CIDB/local
UserTime ratio of the old query).

Related: ClickHouse#129258

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 The appended ASCII / non-ASCII pairs run on different row counts, so the two queries of a pair are no longer directly comparable with each other AGREE, noted The perf report compares each query between the two servers only; one row count cannot keep all 14 copies in 0.2-0.75 s (per-row cost ratio 1.1x-9.0x)
2 💡 Local relative noise of query 25 (leftPadUTF8, non-ASCII) is 0.071, higher than the other copies DISAGREE The report marks a query without history unstable only above 0.25 (compare.sh unstable_threshold); its server CPU noise is lower than the old query's

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-10:20261113-101000

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. 14-day master medians: all 14 queries above 1 s on amd (1020-1939 ms), 12 of 14 on arm. Every local old pass shows the same (1.01-1.74 s per query, 8 pinned cores, max_threads = 8, official master release binary).
b Root cause explained? The queries have no format Null, so perf.py's Python client receives all 10M rows. Locally 96-97% of the server's query time is the network send (92-97% on CI) and the server CPU is 70-280 ms, so the time is the client's decoding, not the functions.
c Fix matches root cause? Yes. The same 14 calls are appended with format Null (rows are still computed, none is sent), each on its own row count; the old queries are disabled, not changed, so no query number or text changes.
d Test intent preserved / new tests added? Yes. Same 7 functions, arguments, ASCII and non-ASCII constants, materialize, single-stream numbers. A three times slower function makes the old query 0.3% slower and the new one 2.8 times slower. The file is the test; no new test.
e Both directions demonstrated? Old/new perf.py passes on the same binary, 3 pairs: new 0.21-0.45 s per query locally, projected 0.20-0.48 s amd and 0.24-0.52 s arm. Queries 0-13 never ran in a new pass (system.query_log). CI timing and noise are checked on this PR's perf runs.
f Fix is general across code paths? N/A (no code). All 14 queries of the file are handled the same way.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no code). Each function keeps both its ASCII and its non-ASCII input.
h Backward compatible? (maintainer-approved exception only) Yes. Queries 0-13 keep their number and text (disabled); 14-27 are new (only 0-13 ever existed for this test).
i Invariants and contracts preserved? Yes. 14 enabled queries, so --max-queries 10 still samples 10 (measured: all 10 in 14-27); no create, fill, settings or shell query in the test.

Session id: cron:clickhouse-impl-slot-5:20261113-091200

@clickhouse-gh

clickhouse-gh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5f80334]

Summary: ✅


AI Review

Summary

PR #131252, head 5f80334fc876f11c64b4ca718be867faf11ba08b, replaces 14 network-bound benchmarks in ascii.xml with FORMAT Null queries on calibrated row counts. It preserves the original function calls, inputs, and historical query indices. No actionable findings.

Missing context / blind spots
  • ⚠️ CI runtime and noise remain unverified: the performance dashboard has no runs for this PR, and the Praktika performance reports contain no test results. The PR supplies three local before/after measurement pairs and a sensitivity check; an amd/arm CI run would confirm the projected timings. No local benchmarks were rerun during this review.
Final Verdict

Status: ✅ Approve. The supplied local measurements support this benchmark-only change; no required code changes identified.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 13, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label Nov 13, 2026
@Algunenano Algunenano self-assigned this Nov 13, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 13, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 13, 2026
Merged via the queue into ClickHouse:master with commit 92f8fd7 Nov 13, 2026
407 of 409 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 13, 2026
@clickhouse-gh clickhouse-gh Bot added comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
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 comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... pr-ci 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.

4 participants