perf: vectorize small u8 table take with NEON - #9571
Conversation
Use NEON TBL for u8-coded tables with at most 16 one-byte values. Signed-off-by: Joseph Isaacs <joseph-isaacs@users.noreply.github.com>
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | compact[(2048, 90)] |
1.6 µs | 1.8 µs | -10.77% |
| ⚡ | WallTime | dict_canonicalize_gt_u8_neon[16000000] |
8,736.5 µs | 778.6 µs | ×11 |
| ⚡ | WallTime | dict_canonicalize_gt_u8_neon[1000000] |
546.5 µs | 50.4 µs | ×11 |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ji/small-u8-table-take-neon (21fa748) with ji/small-u8-table-take-benchmark (d49393c)
Footnotes
-
54 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. ↩
Rationale
Low-cardinality dictionaries with
u8codes and one-byte values can decode through an in-register NEON table instead of arbitrary scalar lookups.Stacked on benchmark baseline #9566. The x86 implementation is intentionally split into the next PR.
Changes
TBLon little-endian AArch64.u8codes, at most 16 one-byte values, and at least 64 rows.CodSpeed wall-time results
Medians over 1,000 samples on Graviton3 metal, compared with #9566:
Runs: baseline, optimized.
Checks
cargo +nightly fmt --all --checkgit diff --check