Conversation
Reuse collect_bool_word for primitive comparison bitmaps while preserving execution-context allocation and comparison semantics. Cover bitmap boundaries, all primitive types, nulls, and constant operand orientation. Signed-off-by: "Matt Katz" <mhkatz97@gmail.com>
Merging this PR will degrade performance by 6.7%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | compare_int_constant_avx2 |
3 µs | 6.4 µs | -52.63% |
| ❌ | WallTime | compare_int_avx2 |
3.5 µs | 6.3 µs | -44.54% |
| ❌ | WallTime | compare_int_nullable_avx2 |
3.9 µs | 6.7 µs | -41.53% |
| ❌ | WallTime | arrow_checked_add_u32_neon[16384] |
12.3 µs | 20.3 µs | -39.52% |
| ❌ | WallTime | compare_u64_avx2 |
4 µs | 6.3 µs | -37.03% |
| ❌ | WallTime | compare_float_avx2 |
5.1 µs | 8 µs | -36.02% |
| ❌ | WallTime | compare_int_eq_avx2 |
3.5 µs | 5.4 µs | -35.47% |
| ❌ | Simulation | decode_primitives[f32, (1000, 512)] |
42 µs | 64.3 µs | -34.68% |
| ❌ | WallTime | lt_i64_nullable_avx2 |
2.9 µs | 4.2 µs | -31.34% |
| ❌ | WallTime | mul_u64_nonnull_neon |
15.4 µs | 20.8 µs | -26.12% |
| ❌ | WallTime | mul_i64_nonnull_neon |
17.3 µs | 20.4 µs | -15.05% |
| ❌ | WallTime | multiply_shapes_neon[(16384, PerRowPerRow)] |
17.3 µs | 20.3 µs | -14.65% |
| ❌ | WallTime | dbp_assemble_kernel_avx2[(I256, 8192)] |
8.5 µs | 9.8 µs | -13.33% |
| ❌ | WallTime | filtered_owned_i64_avx2[OneNullInEight] |
22.3 µs | 25.7 µs | -13.24% |
| ❌ | WallTime | mul_i32_nonnull_avx512 |
7.1 µs | 7.9 µs | -10.25% |
| ⚡ | WallTime | compare_u8_avx2 |
3.4 µs | 1.8 µs | +92.08% |
| ⚡ | WallTime | compare_u8_neon |
3.9 µs | 2.1 µs | +86.39% |
| ⚡ | WallTime | compare_f32_avx2 |
4.6 µs | 3.2 µs | +43.82% |
| ⚡ | WallTime | compare_u8_avx512 |
2.4 µs | 1.7 µs | +38.72% |
| ⚡ | WallTime | compare_f32_avx512 |
3.7 µs | 2.7 µs | +37.49% |
| ... | ... | ... | ... | ... | ... |
ℹ️ 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 mk/primitive-compare-bitmap (0528bdb) with develop (c6678f3)
Footnotes
-
218 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. ↩
Summary
Primitive comparisons currently pack predicate results with a shift-and-OR reduction over 64 rows. In the ARM assembly inspected for this implementation, this expands narrow comparison masks into wider integer lanes and makes bitmap construction expensive.
Use the existing
collect_bool_wordpacker for fixed 64-element chunks in primitive array/array and array/constant comparisons. Full chunks let the compiler prove safe indexing is in bounds and vectorize the predicates before byte-to-bit packing. Partial words use the existing scalar tail path.Changes
This is independent of NarrowArray and changes no benchmark source or public API.
Performance
Existing comparison benchmarks, unchanged, on Apple M5 Max (aarch64), Rust 1.98.0, 8,192 rows.
Median of three run medians per benchmark, 200 samples per run.
compare_f32compare_floatcompare_intcompare_int_constantcompare_int_eqcompare_int_nullablecompare_u8compare_u64