perf(compressor): Improve string dictionary selection - #9762
Conversation
Signed-off-by: Will Manning <will@willmanning.io>
Merging this PR will regress 3 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | mul_u64_nonnull_neon |
15.3 µs | 21.1 µs | -27.31% |
| ❌ | WallTime | multiply_shapes_neon[(16384, PerRowPerRow)] |
17.2 µs | 20.2 µs | -14.58% |
| ❌ | WallTime | mul_i64_nonnull_neon |
17.2 µs | 20.1 µs | -14.28% |
| ⚡ | WallTime | arrow_checked_add_u32_neon[16384] |
20.5 µs | 12.7 µs | +60.66% |
| ⚡ | WallTime | mul_u32_nonnull_avx2 |
6.9 µs | 5.9 µs | +16.83% |
| ⚡ | WallTime | mul_u32_nonnull_avx512 |
6.3 µs | 5.6 µs | +11.8% |
| ⚡ | Simulation | allocate_drop_bytes[0] |
520.2 ns | 466 ns | +11.62% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing wm/string-dictionary-selection (6ed06bd) with develop (265b705)
Footnotes
-
206 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Benchmarks: Compression 📖Commits: PR vortex / vortex-file-compressed / ns (1.016x ➖, 0↑ 2↓)
vortex / vortex-file-compressed / bytes (1.000x ➖, 0↑ 0↓)
vortex / vortex-file-compressed / ratio (1.008x ➖, 0↑ 2↓)
vortex / parquet / ns (1.004x ➖, 0↑ 0↓)
vortex / parquet / bytes (1.000x ➖, 0↑ 0↓)
vortex / arrow-ipc / ns (1.012x ➖, 1↑ 1↓)
vortex / arrow-ipc / bytes (1.000x ➖, 0↑ 0↓)
|
Signed-off-by: Will Manning <will@willmanning.io>
String Dictionary selection now probes a small distributed sample before it builds an exact candidate. The old estimator missed profitable dictionaries when columns contained thousands of repeated strings. Samples above 75% distinct values reject Dictionary. An incomplete probe uses the existing estimator. An admitted candidate has explicit limits for values, value bytes, code bytes, and input bytes. The compressor compares the candidate's actual size and reuses the candidate if it wins.
The probe reads at most 8,192 rows and 1 MiB of values. String samples now compact their payload before size estimates, so unrelated retained bytes do not distort the score.
On seven local runs of the standard compression benchmark, Euro2016 stayed effectively neutral: write +0.01%, full materialization +0.46%, and size -0.14%. HashTags wrote 4.4% faster and used 2.1% fewer bytes, but full materialization was 10.9% slower. The benchmark expands Dictionary into flat strings. Engines that preserve Dictionary can retain the encoded form.
🤖 Generated with Codex