Repository navigation
Ask the compressor plugin which encoding it produces - #11307
robert3005 wants to merge 3 commits into
Conversation
Add `may_compress_to` to `CascadingCompressor` and `CompressorPlugin`. The check runs only the immediate estimates of the schemes that produce the requested encoding, and does not compress. `DictStrategy` uses it to skip the full sample compression when the result cannot be a dictionary. Signed-off-by: Robert Kruszewski <github@robertk.io>
f726498 to
72e22e0
Compare
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
Signed-off-by: Robert Kruszewski <github@robertk.io>
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Benchmarks: Compression 📖Commits: PR vortex / vortex-file-compressed / ns (0.999x ➖, 0↑ 0↓)
vortex / vortex-file-compressed / bytes (1.000x ➖, 0↑ 0↓)
vortex / parquet / ns (0.997x ➖, 0↑ 0↓)
vortex / parquet / bytes (1.000x ➖, 0↑ 0↓)
vortex / arrow-ipc / ns (0.993x ➖, 0↑ 1↓)
vortex / arrow-ipc / bytes (1.000x ➖, 0↑ 0↓)
|
connortsui20
left a comment
There was a problem hiding this comment.
I think this is now doing extra work in the case that dict is the thing that we want. We might want to design this a bit more carefully, but the idea is right
Replace `CompressorPlugin::may_compress_to(chunk, encoding)` with `encoding_for(chunk)`, which returns the encoding that `compress_chunk` gives. The default compresses the chunk. The dict writer compares the answer with `Dict`. `CascadingCompressor` splits scheme selection from the winner's compression, so `compress` and `encoding_for` share one selection. A new `Scheme::root_encoding` lets `encoding_for` skip the full compression when the winner always produces the same root encoding. Signed-off-by: Robert Kruszewski <github@robertk.io>
Replace
CompressorPlugin::may_compress_to(chunk, encoding)withencoding_for(chunk), which returns the encoding thatcompress_chunkgives. The dict probe compares the result withDict.CascadingCompressor::encoding_forruns the normal scheme selection. It skips the full compression when the winner declares a fixed root encoding through the newScheme::root_encoding.🤖 Generated with Claude Code