Repository navigation
Update zstd to upstream dev with pending performance PRs - #127206
Algunenano wants to merge 5 commits into
Conversation
Rebase of the `ClickHouse/zstd` fork onto upstream `dev` (`49cf5179`), keeping the vectorized overlap-copy patches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
meta/zstd#4751, ClickHouse#4764, ClickHouse#4841, ClickHouse#4732 and ClickHouse#4811 on top of the rebased fork. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [50e6d81] Summary: ❌
AI ReviewSummaryUpdates Final VerdictStatus: ✅ Approve |
Drop the row matchfinder change, which has a big-endian bug and no gain at `ZSTD(3)`, and add the fix for the legacy v0.5 streaming regression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes18 object files changed (+86.26 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units42 translation units recompiled, 26 s compile time in total, 42 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.30 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
`contrib/zstd` moves to `8388bfaec` on `ClickHouse/dev-20261021` of https://github.com/ClickHouse/zstd: the same set as before (`984dab56b`) plus a branchless copy of matches with offsets below 16 (NEON `tbl`, SSSE3 `pshufb`, AVX2 `vpshufb`). It replaces the `offset < 8` branch of `ZSTD_overlapCopy8`, which mispredicts often on numeric columns. Graviton4, ClickBench `hits` columns at level 3 with ClickHouse block sizes: decompression +5.6% geomean over 13 columns (`ClientIP` +45%, `UserID` +14%), no column slower. In ClickHouse with 16 threads, the `ClientIP` scan is 1.20x and the `UserID` scan 1.07x faster. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Failures are unrelated and fixed in #127186 |
Updates
contrib/zstdto a rebase of theClickHouse/zstdfork onto upstreamdev(49cf5179, 2026-10-05; the old fork was 199 non-merge commits behind), plus pending upstream PRs and one new patch of ours. Fork branch:ClickHouse/dev-20261021(8388bfae). The overlap-copy patches of the old fork are kept; its unwind-info patches are upstream already.Changes on top of upstream
dev:ZSTD(3).ZSTD(16)and above).devin streaming decompression of legacy v0.5 frames (Destination buffer is too smallonce a frame crosses its window).tbl, SSSE3pshufb, AVX2vpshufb). It replacesZSTD_overlapCopy8, whose branch onoffset < 8mispredicts on numeric columns where offsets like 4, 8 and 12 alternate.Compressed output is byte-identical to the current fork at levels 1, 3, 6, 9 and 16, and the checksum of all columns of ClickBench
hitsis the same after decompression.ClickBench
hits(100M rows in oneZSTD(3)part, no columns cache, median of 20 hot runs, non-LTO local build) on AMD EPYC 9R14 (Zen 4), speedup vs current master:SELECT count() FROM hits WHERE NOT ignore(SearchPhrase)URLTitleClientIPRegionIDUserIDSELECT sum(cityHash64(*)) FROM hitsSELECT COUNT(DISTINCT SearchPhrase) FROM hitszstd CLI on the same data, single core,
ZSTD(3), ClickHouse block sizes, vs current master: compression 1.018x, decompression 1.175x (geomean over 7 numeric columns and the separate characters and sizes streams of 4Stringcolumns). The short-offset copy alone, vs the same set without it:ClientIP1.15x,UserID1.12x,RegionID1.085x,ResolutionWidth1.065x, and the characters streams of long strings 1-2% slower; in ClickHouse it is 1.12x on theClientIPscan, 1.08x onUserID, 1.06x onRegionID, 0.98x onURLandTitle, 1.01x onsum(cityHash64(*))and 1.02x onCOUNT(DISTINCT SearchPhrase)(16 threads). On Graviton4 it is +5.6% CLI decompression geomean,ClientIP+45%,UserID+14%, and 1.20x on theClientIPscan in ClickHouse.Earlier measurements of the same set without the short-offset copy, vs current master:
SearchPhrase/URL/Titlescans 1.24x / 1.17x / 1.20x with 16 threads on 8 cores,COUNT(DISTINCT SearchPhrase)1.12x. WithZSTD(3), theINSERT INTO ... SELECTof the whole table uses 2% less CPU andOPTIMIZE FINALof 5 parts (20M rows) takes 36.5 s instead of 37.5 s.ZSTD(3)compression on Intel and neutral on Graviton4; opt: tabulate the optimal parser's per-code price components meta/zstd#4732 is +13% (Intel) and +17% (Graviton4) atZSTD(16).Evaluated and not included:
Related: #124405
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Update
zstdto the latest upstream development version with pending performance improvements. Decompression ofZSTD(3)data is up to 20% faster on x86.Workflow [PR]
Sync PR [sync-upstream/pr/127206]