Repository navigation
Conversation
…ar-init ClickHouse builds with -ftrivial-auto-var-init=zero. With it, clang zero-fills `seqState`, the `sequences` ring and the decoded `seq_t` temporaries in the sequence decoders, which changes how they are compiled. On aarch64 that makes decoding slower: up to +24% in the ClickHouse performance tests codecs_float_select and ip_trie (ClickHouse/ClickHouse#127909). Every byte of these locals is written before it is read, so mark them with a new ZSTD_UNINITIALIZED (`__attribute__((uninitialized))`, empty where unsupported). With clang 22, ZSTD_decompressSequences, ZSTD_decompressSequencesSplitLitBuffer and ZSTD_decompressSequencesLong then compile to the same code as without the flag, on both aarch64 and x86-64. Builds without the flag are not affected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Oct 28, 2026
…init=zero` The remaining arm_release slowdowns on this PR come from contrib code: `codecs_float_select` ClickHouse#11 (+24%) and `ip_trie` ClickHouse#2 (+18%) decode `ZSTD`, and `collations` ClickHouse#1 (+16%) compares strings with ICU. - contrib/zstd -> ClickHouse/zstd#6 (0c4a7b5): `seqState`, the `sequences` ring and the decoded `seq_t` temporaries of the sequence decoders. `ZSTD_decompressSequences`, `...SplitLitBuffer` and `...Long` then compile to the same code as without the flag on aarch64 and x86-64. - contrib/icu -> ClickHouse/icu#3 (e16b61b): the two collation iterators of the UTF-8 `RuleBasedCollator::doCompare`, 400 or 496 bytes each, zero-filled on every comparison that leaves the Latin fast path. Local amd64 release builds, flag only vs with these annotations (max_threads=1, 3 x 7 runs): ORDER BY ... COLLATE 'tr' on 2M Cyrillic strings 0.131 s -> 0.113-0.119 s; the ZSTD Float64 scan returns to 0.183 s, as without the flag (0.164 s with it). Query results are identical (8 collations, zstd levels 3 and 19 with a 128 MiB window, a ZSTD MergeTree column). Co-Authored-By: Claude Opus 5.5 <[email protected]>
motsc
previously approved these changes
Oct 29, 2026
motsc
dismissed
their stale review
October 29, 2026 15:02
AI-generated approval submitted from @motsc without explicit per-PR authorization or disclosure; withdrawn so an independent maintainer can review.
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.
ClickHouse builds with
-ftrivial-auto-var-init=zeroin ClickHouse/ClickHouse#127909. With it, clang zero-fillsseqState, thesequencesring and the decodedseq_ttemporaries in the sequence decoders, and that changes how they are compiled: onarm_releasethe Performance Comparison showscodecs_float_selectmeta#11 +24% andip_trie#2 +18%, both decodingZSTD.Every byte of these locals is written before it is read, so this marks them with a new
ZSTD_UNINITIALIZED(__attribute__((uninitialized)), empty where the attribute is unsupported). With clang 22,ZSTD_decompressSequences,ZSTD_decompressSequencesSplitLitBufferandZSTD_decompressSequencesLongthen compile to the same code as without the flag on aarch64 and x86-64 (object-level disassembly compared with the CI compile lines). Builds without the flag are unchanged.Decompressed output is identical (zstd CLI levels 3 and 19 with a 128 MiB window, and a ClickHouse
ZSTDcolumn), and ClickHouse/ClickHouse#127909 pins this commit so that its Performance Comparison measures it.