Repository navigation
Four optimisations of T64 decompression - #120414
Conversation
...by using a smaller matrix
|
Workflow [PR], commit [0d31535] Summary: ✅
AI ReviewSummaryThis PR rewrites the Findings
Final Verdict
LLVM Coverage ReportMeasured on commit 0d31535.
Changed lines: Changed C/C++ lines covered: 155/155 (100.00%) · Uncovered code |
|
|
||
| <fill_query>OPTIMIZE TABLE t64_select_{case} FINAL SETTINGS optimize_throw_if_noop=1</fill_query> | ||
|
|
||
| <query>SELECT count() FROM (SELECT n FROM loop(t64_select_uint8_one_byte) WHERE ignore(n) = 0 LIMIT 5367000000)</query> |
There was a problem hiding this comment.
This benchmark definition is useful, but the PR contract here is a measured Performance Improvement, not just a new perf test. During review the PR report still had the Performance Comparison shards pending and no uploaded all-query-metrics.tsv artifacts, so there is no before/after evidence yet that these new decode paths are a net win on the target architectures.
Please attach the perf-comparison output for this PR, or paste focused before/after numbers from this new benchmark in the PR description.
There was a problem hiding this comment.
Wait for CI to finish, duh
|
📊 Cloud Performance Report ✅ AI verdict: Release-transition baseline: compared against the most recent available 26.9 masters at or before the trusted base-commit anchor because no 26.10 master baseline exists there. no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
|
@4ertus2 FYI |
| src += bytes_to_skip; | ||
| dst += bytes_to_skip; | ||
|
|
||
| if (uncompressed_size % sizeof(T) != 0) |
There was a problem hiding this comment.
Why it's possible to remove it?
There was a problem hiding this comment.
Because a few lines above we have
UInt8 bytes_to_skip = uncompressed_size % sizeof(T);
...
uncompressed_size -= bytes_to_skip;After that uncompressed_size % sizeof(T) is always 0
UInt8 is char8_t, which has no aliasing exemption
| @@ -415,6 +423,7 @@ void reverseTransposeBytes(const UInt64 * matrix, UInt32 col, T & value) | |||
| value |= static_cast<UInt32>(matrix8[64 * 1 + col]) << (8 * 1); | |||
There was a problem hiding this comment.
64 * 1, (8 * 1)
these multiplication were self descriptive in original version. For now they look strange. You touch the code above them. Could you fix them too?
On O3 we'd get same instructions as with constexpr ladder
|
|
||
| template <typename T> | ||
| void reverseTransposeMatrixBytes(const UInt64 * matrix, T * buf, UInt32 tail) | ||
| T restoreUpperBits(T value, T upper_min, T upper_max, T sign_bit) |
There was a problem hiding this comment.
As soon as you change it it's possible to improve its semantic.
Here #94499 it's possible to save not only upper bits but intermediates too. So it's better to rename this function:
T restoreCommonBits(T value, T common_negative, T common_positive, T sign_bit)
Build profile diff (arm_release)Commit See the job log for details. |
|
It's really hard to check and approve the new SIMD logic. So there sould be a unit test with compression-decompression cycle for values 1 and 2. It will guaranty that no-simd version decompreses simd compression. And visa versa. |
|
Went with a compile-time split. The transposes now are in a separate header with |
|
@4ertus2 do you think this PR is ready to be shipped? |
LGTM |
Edited by the nightly changelog CI job following .claude/skills/edit-changelog/SKILL.md. Changelog-revert: 121902 121901 docs(managed-postgres): updated Private Service Connect Changelog-revert: 122310 120414 Revert "Four optimisations of `T64` decompression" Changelog-revert: 122326 115526 Revert "Publish a failing job step's cause to CIDB, not just the failure count" Changelog-deleted-entry: 120414 [Performance Improvement] [raw] * Faster decompression of `T64`-encoded columns. [#120414](#120414) ([Raufs Dunamalijevs](https://github.com/rienath)).
This PR is important for adaptive codec selection (
enable_adaptive_codec_selection) as it relies on T64.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Faster decompression of
T64-encoded columns.Workflow [PR]
Sync PR [sync-upstream/pr/120414]
Version info
26.10.1.670-master(included in26.10and later)