Repository navigation
Stop resolving the UTC time zone in TimezoneMixin - #115488
Conversation
`TimezoneMixin` resolved the UTC time zone in its constructor, in addition to the named or default one. Building a `DateLUTImpl` walks ~146k days through cctz (~70M instructions), and `DataTypeDateTime` / `DataTypeDateTime64` are constructed just to name a column type - for example when building the schemas of the system tables - without ever touching UTC. Only the serializations need it, for ISO output and the `best_effort` parsers, so they declare their own `utc_time_zone` and pay for it once per formatter. This is one of the sources of startup work found while profiling `clickhouse local --query "SELECT 1"`, which spent most of its time before the query. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [a445963] Summary: ✅
AI ReviewSummaryThis PR removes eager Tests
Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 10/10 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units598 translation units recompiled, 4344 s compile time in total, 598 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR removes an always-unused UTC DateLUT build from DateTime/DateTime64 type construction — a startup and type-construction cost, not a query-execution change. Every flagged query is an improvement, across unrelated operations including pure-Date TPC-H queries that never construct a DateTime type, and the changed code does not run in any of these hot paths, so all directional deltas were downgraded to not-sure as systematic run-to-run variance (note also only 6 source runs vs 30 base). Q31's within-envelope suppression is consistent with that same one-directional offset and stands. Re-run on matched hardware to confirm these numbers are noise before reading any speedup into them. clickbenchFlagged queries (8 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_officialFlagged queries (2 of 22)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
While profiling
clickhouse local --query "SELECT 1"it turned out that almost all of the run happens before the query: the query itself took 1ms of a 45ms run. This is one of the sources of that startup work, split out of #112496.TimezoneMixinresolved the UTC time zone in its constructor, in addition to the named or default one. Building aDateLUTImplwalks ~146k days through cctz, about 70M instructions, andDataTypeDateTime/DataTypeDateTime64get constructed just to name a column type — for example when building the schemas of the system tables — without ever touching UTC.Only the serializations need UTC, for ISO output and for the
best_effortparsers, soSerializationDateTime,SerializationDateTime64and theDateTime/DateTime64nodes ofJSONExtractTreedeclare their ownutc_time_zonemember instead. The cost is then paid once per formatter rather than once per named type.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Naming a
DateTimeorDateTime64type no longer builds a UTC time zone lookup table that nothing reads, which makes constructing these types — and therefore starting upclickhouse localandclickhouse client— faster.Workflow [PR]
Sync PR [sync-upstream/pr/115488]
Version info
26.8.1.1780(included in26.8and later)