Execute primitive comparisons with RowFn - #9346
Conversation
Merging this PR will degrade performance by 25.86%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | case_when_nary_10_conditions[10000] |
747.2 µs | 2,008 µs | -62.79% |
| ❌ | Simulation | case_when_nary_equality_lookup[10000] |
515.1 µs | 1,151.7 µs | -55.27% |
| ❌ | Simulation | case_when_nary_early_dominant[10000] |
383.8 µs | 765.4 µs | -49.86% |
| ❌ | Simulation | case_when_nary_3_conditions[10000] |
385.3 µs | 766.7 µs | -49.75% |
| ❌ | Simulation | case_when_all_false[100000] |
1.1 ms | 2.1 ms | -49.36% |
| ❌ | Simulation | case_when_all_true[100000] |
1.1 ms | 2.1 ms | -49.23% |
| ❌ | Simulation | case_when_simple[100000] |
1.2 ms | 2.3 ms | -48.82% |
| ❌ | Simulation | case_when_without_else[100000] |
1.2 ms | 2.4 ms | -47.08% |
| ❌ | Simulation | case_when_nary_10_conditions[1000] |
401.7 µs | 693.7 µs | -42.09% |
| ❌ | Simulation | case_when_all_false[10000] |
211.3 µs | 341.6 µs | -38.14% |
| ❌ | Simulation | case_when_all_true[10000] |
215.7 µs | 347.6 µs | -37.95% |
| ❌ | Simulation | case_when_simple[10000] |
243.7 µs | 372.6 µs | -34.59% |
| ❌ | Simulation | case_when_nary_equality_lookup[1000] |
310.2 µs | 467.6 µs | -33.67% |
| ❌ | Simulation | case_when_without_else[10000] |
260.2 µs | 392.1 µs | -33.63% |
| ❌ | Simulation | bench_compare_sliced_dict_primitive[(5000, 10000)] |
183.4 µs | 271.7 µs | -32.51% |
| ❌ | Simulation | bench_compare_sliced_dict_primitive[(3333, 10000)] |
159.7 µs | 228.7 µs | -30.19% |
| ❌ | Simulation | case_when_nary_early_dominant[1000] |
226.3 µs | 321.9 µs | -29.69% |
| ❌ | Simulation | bench_compare_sliced_dict_primitive[(7500, 10000)] |
246.8 µs | 349.1 µs | -29.32% |
| ❌ | Simulation | bench_compare_sliced_dict_primitive[(2500, 10000)] |
146.2 µs | 206.3 µs | -29.11% |
| ❌ | Simulation | case_when_nary_3_conditions[1000] |
229.7 µs | 321.6 µs | -28.57% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ct/row-fn-primitive-comparisons (1f269ba) with ct/row-fn-numeric-operators (9be3db4)2
Footnotes
-
89 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. ↩
-
No successful run was found on
ct/row-fn-numeric-operators(a517965) during the generation of this report, so 9333788 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
04d477e to
2db7f1e
Compare
2db7f1e to
496e733
Compare
496e733 to
654caec
Compare
654caec to
213f008
Compare
|
Here are the local primitive-comparison benchmark results from the final Rust 1.97.1 run. The comparison used a The machine was an AMD Ryzen 9 7950X running Linux. The build used rustc 1.97.1, LLVM 22.1.6, one CGU, fat LTO, and Negative changes are faster. The values are medians across the seven paired runs. The per-row All primitive-comparison results: 25 cases
|
d3c95a3 to
b1ea2ec
Compare
b1ea2ec to
e4c90c8
Compare
50f20d9 to
63fe058
Compare
a8788e7 to
83599c0
Compare
83599c0 to
9de6e71
Compare
Use RowFn for primitive comparisons while retaining fused x86 bit-packing for the measured wide ordered cases where LLVM generates faster code. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Cover lane widths, equality, nullability, and both constant operand positions for primitive comparison dispatch. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
9de6e71 to
1f269ba
Compare
Rationale for this change
Moves primitive comparisons to
RowFnwhere native measurements support it. The faster fused x86 path remains for selected 64-bit comparisons.RowFnAPI #9129RowFnover Vortex arrays #9130What changes are included in this PR?
The columnar path handles equality for
i64,u64, andf64, alli64andf64operators, and mixed-constantu64operators. Tests force both paths over identical values, validity, NaN, signed zero, and constant positions. Their encoding difference is intentional: columnar execution materializes aBoolArray, while row execution keeps a lazy mask chain.With Rust 1.97.1 and LLVM 22.1.6, optimized IR and assembly confirm that mixed-constant primitive comparisons vectorize under the 16-CGU, no-LTO benchmark profile. The earlier 8.3–8.5x mixed-constant regressions were measured before the output-iterator fix in #9353 and no longer describe this branch. The fused comparison and bit-packing path remains about 38% faster for
compare_u64_constant.What APIs are changed? Are there any user-facing changes?
There are no public API changes. The path selector and forced-path controls remain internal.