Skip to content

Disable the JSON hashing query of the hashing_serialized_values performance test - #132468

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:disable-json-hashing-perf-query
Nov 18, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:disable-json-hashing-perf-query

Conversation

@groeneai

@groeneai groeneai commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #111005
Related: #124728

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):

Query #1 of the hashing_serialized_values performance test (sipHash64 over a JSON column) is disabled, because its time depends on the code layout of each build rather than on the change being tested.

Description

Performance Comparison (amd_release, master_head, 2/6) failed on #111005 with hashing_serialized_values #1 as its only blocker, 0.526 -> 0.611 s (report), although #111005 only changes replaceRegexpOne/replaceRegexpAll. Another PR had the same red, 0.534 -> 0.660 s (report), and master runs also mark this query slower.

The build decides this, not the change. Both servers do the same work (7.333G vs 7.337G instructions in the red job), but in some builds the per-row loop gets one or two extra branch misses per row: 0.125M vs 4.143M in the red job, over 4M rows. ASLR is off in this job, so the slow mode is fixed per binary: the confirmation reruns at three stack placements and the dashboard reruns all reproduced +16.5%. Any PR that relinks this code redraws the mode against its reference.

#1 is now disabled="1", which keeps the numbers and history of #0 and #2, and the json_values table that only #1 read is removed. #0 (xxHash64 over Variant) still measures the row-by-row serialization branch of executeGeneric this test was added for, and #2 the aggregate-state path. A shorter loop would not fix it: in the slow builds the rest of it is about 30% slower too.

Validation: perf.py --print-queries prints the same three queries. On two local servers the test runs without errors, #0 and #2 run 8 times each, and system.query_log shows #1 is never sent. The red job's two binaries reproduce #1 here: 0.495 vs 0.595 s, equal instructions, 1M vs 21M branch misses over 5 runs (perf stat).

🤖 Generated with Claude Code


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

Version info

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

…rmance test

Query 1 (sipHash64 over a JSON column) failed Performance Comparison
(amd_release) on PRs that do not touch its code path (ClickHouse#111005: 0.526 ->
0.611 s, and another PR: 0.534 -> 0.660 s) and is marked slower on
master runs.

Both servers execute the same work (7.333G vs 7.337G instructions in the
ClickHouse#111005 job, within 0.15% in 18 of the 19 profiled runs; the 19th is a
PR that changes this loop), but the per-row loop through
SerializationObject, SerializationDynamic, path iteration and four
hash-map lookups lands in a slow mode in some builds: one or two extra
branch misses per row (0.125M vs 4.143M over 4M rows in the ClickHouse#111005
job), or more cycles at equal misses. ASLR is off, so the mode is fixed
per binary: the confirmation reruns at three stack placements and the
dashboard reruns all reproduced +16.5%. The red job's two binaries
reproduce it locally (0.495 vs 0.595 s, same instructions, 1M vs 21M
branch misses over 5 runs).

Shortening the loop does not remove the dependence (the remaining frames
are about 30% slower in the slow builds too), so the query is disabled with
disabled="1", which keeps the numbers and history of queries 0 and 2, and
the json_values table that only it read is removed. Query 0 still measures
the row-by-row serialization branch of executeGeneric, query 2 the
aggregate-state path.

Related: ClickHouse#111005

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 review of the diff (1 finding, in the commit message only).

# Sev Finding Verdict Evidence / action
1 ⚠️ The commit message named an unrelated PR by number and overstated how many profiled runs had equal instruction counts AGREE, fixed @ 39db70c message reworded, tree unchanged

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

Session id: cron:clickhouse-review-slot-8:20261117-194200

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @Algunenano, could you review this? It disables query 1 of hashing_serialized_values (sipHash64 over JSON), whose time is set by each amd build's code layout (one or two extra branch misses per row at equal instructions), and drops the json_values table only it read; queries 0 and 2 keep their indices and history.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With the red job's two CI binaries on two local servers, #1 takes 0.495 vs 0.595 s on every run (same instructions, 1M vs 21M branch misses over 5 runs). In CI it reproduced at 3 stack placements and in 3 dashboard reruns.
b Root cause explained? The per-row JSON hash loop of #1 falls into a slow mode in some builds (one or two extra branch misses per row, or a cycles/iTLB mode) at identical work. ASLR is off, so the mode is fixed per binary, and any relink of this code draws it again, which gives reds on unrelated PRs.
c Fix matches root cause? Yes. The query itself is layout-sensitive, so it is disabled with the repo's disabled="1" mechanism. A shorter loop would not help (measured slow/fast 1.30 vs 1.37 today).
d Test intent preserved / new tests added? #0 still covers the row-serialization branch of executeGeneric that the test was added for, and #2 the aggregate-state path. Test-only change, so no new test.
e Both directions demonstrated? Master xml: #1 is sent and is 20% slower with the red job's binaries. Edited xml: #1 is never sent (system.query_log), #0 and #2 run 8 times each, no errors.
f Fix is general across code paths? N/A, no source change. #0 shows the same kind of effect at about half the rate and is kept.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A, no source change.
h Backward compatible? (maintainer-approved exception only) Yes. disabled keeps query_index, so the history of #0 and #2 is unchanged. No settings change.
i Invariants and contracts preserved? Yes. perf.py --print-queries output is identical, the states setup and teardown are unchanged, and the coverage jobs skip disabled queries.

Session id: cron:clickhouse-impl-slot-6:20261117-191100

@clickhouse-gh

clickhouse-gh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [39db70c]

Summary: ✅


AI Review

Summary

Disables the layout-sensitive JSON hashing query in hashing_serialized_values and removes its unused table setup and teardown, preserving the indices of the remaining benchmarks. Reviewed the complete diff, current code, prior discussion, runner and coverage paths, and linked CI evidence. No actionable findings for commit 39db70c8e829524abe575c55c4e06acc71e69544.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 17, 2026
@Algunenano Algunenano self-assigned this Nov 17, 2026
@Algunenano
Algunenano added this pull request to the merge queue Nov 17, 2026
Merged via the queue into ClickHouse:master with commit a56b118 Nov 18, 2026
385 of 386 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 18, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 20, 2026
…any-rows-every-type

Conflicts: src/Common/SipHashStrings.{h,cpp} keep master's `*Rows` functions and
this branch's ones; the perf tests keep master's queries and append this branch's
after them. The `sipHash128(j)` query is dropped with the `json_values` table
master removed in ClickHouse#132468.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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.

3 participants