JonSnow1807 commented on issue #11543: URL: https://github.com/apache/arrow-rs/issues/11543#issuecomment-6690615702
Pushed the variants to branches on my fork (https://github.com/JonSnow1807/arrow-rs, `bench-11543-baseline`, `-block8`, `-cand1`, `-cand2`, `-cand3`, all on d3b09aaf) and ran the `filter_bits` 1/16 rows on the GitHub arm runners, which were Neoverse-N2 every time. Three baseline runs agree within 0.5% at 1/16 (indices 4.68 / 4.69 / 4.70 µs, batched 715.4 / 712.3 / 713.3 µs), so differences above ~1% are real. Change vs baseline at 1/16: | variant | single-buffer "kept 1/16" rows (baseline 4.69 µs) | batched "random, kept 1/16" (baseline 713 µs) | |---|---|---| | block8 (8-word block) | +44 to +46% | +14% (810.3 µs) | | cand1 (2-word count window) | -5% | -4% (684.0 µs) | | cand2 (sparse gate + 2-bit extraction) | -4.5% | -15% (606.2 µs) | | cand3 (2-word shared extraction loop) | +10.5% | -21% (565.0 µs) | So on N2 the 8-word block isn’t a 1/16-only regression: it is also slower at every other density I ran (+9% at 15/16 up to +64% at 1/256). The other three win at 1/16 but lose at 1/256 (+9 to +22%) and at 1/1024 (cand2 +16%, cand3 +13%), the same trade-off as on the M2. My guess for why 1/16 behaves differently, from the code only (no hardware counters on these runners): at 1/16 nearly every word is non-empty with about 4 kept bits, so every word goes through the data-dependent `while mask != 0` compress loop, and its exit is hard to predict. Sparser densities mostly skip empty words, and denser ones go to `compress_bytes`. The `len / 64` sparse-index cut-off doesn’t come into play at 1/16. x86 numbers are in the runs too, but the hosted x86 pool mixed EPYC 7763, 9V45 and 9V74, so only same-CPU comparisons mean anything: on a 7763 without `pext`, cand1 and cand2 were faster at 1/16 (batched -9.6% and -21.2%). Runs (each has `arm`, `x86` and `x86-bmi2` jobs with lscpu output and criterion results as artifacts): - baseline: https://github.com/JonSnow1807/arrow-rs/actions/runs/42254668671, reruns https://github.com/JonSnow1807/arrow-rs/actions/runs/42256225698 and https://github.com/JonSnow1807/arrow-rs/actions/runs/42256238130 - block8: https://github.com/JonSnow1807/arrow-rs/actions/runs/42254670612 - cand1: https://github.com/JonSnow1807/arrow-rs/actions/runs/42254668624 - cand2: https://github.com/JonSnow1807/arrow-rs/actions/runs/42254672202 - cand3: https://github.com/JonSnow1807/arrow-rs/actions/runs/42254677595 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
