Repository navigation
Update zstd to upstream dev with pending performance PRs - #127206
Draft
Algunenano wants to merge 4 commits into
Draft
Algunenano wants to merge 4 commits into
Algunenano wants to merge 4 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Contributor
|
Workflow [PR], commit [e37a4a6] Summary: ❌
AI ReviewSummaryPR #127206, reviewed at Missing context / blind spots
Final VerdictStatus: ✅ Approve. No required code changes. |
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 <noreply@anthropic.com>
Contributor
Build profile diff (arm_release)Commit See the job log for details. |
`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) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.