Repository navigation
Conversation
|
Workflow [PR], commit [7f91713] Summary: ✅
AI ReviewSummaryThis PR extends Findings
Final VerdictStatus: Minimum required actions: provide performance evidence for the merge-time chain-pricing path ( LLVM Coverage ReportMeasured on commit 7f91713.
Changed lines: Changed C/C++ lines covered: 117/123 (95.12%) · Uncovered code |
| for (const auto & [codec, chain] : pool) | ||
| { | ||
| /// A candidate without a chain that reports its size cheaply is measured rather than compressed. | ||
| if (auto calculated = chain ? std::nullopt : codec->tryGetCompressedSize(source, source_size)) |
There was a problem hiding this comment.
This removes the cheap tryGetCompressedSize path as soon as a generic default codec makes chaining possible. For the common integer/date case, T64 now has to materialize a full compressed block on every merge-time block just so T64 + default can be priced, even when the winner still ends up being NONE or the default codec.
That is extra CPU work in a hot path, and the PR currently does not show that it is acceptable: the perf-comparison jobs were skipped on this PR, and tests/performance/adaptive_codec_merge.xml comments out the two merge legs that would have exercised this new pricing path. I think this needs either a cheaper gate/sampling step before we pay for the first-stage compression, or benchmark evidence that the added work is acceptable.
There was a problem hiding this comment.
On purpose. When we have a chain T64 + ZSTD, we have to compress T64 anyway. Doing a compression of T64 separately just gives us first layer of chain later for free.
| @@ -1,33 +1,52 @@ | |||
| <test> | |||
| <!-- TODO: uncomment the adaptive_codec_merge and adaptive_codec_merge_chain legs once sampling lands. --> | |||
There was a problem hiding this comment.
- I reduced size of
adaptive_codec_mergeas it was taking a bit too long for our CI. - I commented out
adaptive_codec_mergetest. - I added a commented out
adaptive_codec_merge_chain.
2 and 3 get slower because of this PR. This is expected as we increase number of candidates for adaptivity. But this will be fixed (in fact, they would be faster than current master) when sampling lands. It's strange that I am adding a new test that is commented out, but it makes sense to do it now as it's relevant
| for (const auto & [codec, chain] : pool) | ||
| { | ||
| /// A candidate without a chain that reports its size cheaply is measured rather than compressed. | ||
| if (auto calculated = chain ? std::nullopt : codec->tryGetCompressedSize(source, source_size)) |
There was a problem hiding this comment.
On purpose. When we have a chain T64 + ZSTD, we have to compress T64 anyway. Doing a compression of T64 separately just gives us first layer of chain later for free.
Build profile diff (arm_release)Commit See the job log for details. |
| for (size_t idx = 0; idx < chain.size(); ++idx) | ||
| dest[1 + idx] = chain[idx]->getMethodByte(); |
There was a problem hiding this comment.
Do we rewrite the whole chain method byte prefix?
There was a problem hiding this comment.
Yes. With one codec we didn't need a prefix as we know from 9-byte header the codec. With chain, 9 byte header just tells us it's CodecMultiple and then we have a prefix [length][codec_1]...[codec_length]. With completed_stages >= 1 we only pass the data, no prefix. So there's no prefix to keep
Every type-specific candidate now also forms a chain with table's default codec, when that default is a general-purpose compression. For example, integers would now be tried with
{NONE}, {ZSTD(3)}, {T64}, {T64 + ZSTD(3)}. A chain is not compressed from scratch. Its first codec has just been compressed as a candidate of its own, so we take that block and run only the remaining stage.Along the way
Multiplelost two copies it made on every block, which speeds up compression on every user-declared chain as well.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Adaptive codec selection (
enable_adaptive_codec_selection) also tries each specialised codec followed by the table's default codec.Workflow [PR]
Sync PR [sync-upstream/pr/121630]
Version info
26.10.1.901-master(included in26.10and later)