Repository navigation
Commit 3c4b8df
committed
perf: speed up Utf8View/BinaryView hashing
Specialize the Utf8View/BinaryView hash dispatch:
- Inlined-only paths (no external buffers) get an unrolled u128 hot loop
for fresh and rehash. Lane widths are narrower than the primitive
variants (8-way fresh, 4-way rehash) to avoid spilling u128 lanes.
- Nullable inlined-only paths walk the null bitmap in u64 chunks and
branchlessly csel-blend mixed chunks, instead of paying per-row
`is_null`.
- Buffered paths (external data buffers) keep the per-row loop since
buffer-load latency dominates the null check.
Measured on M4 Max, BATCH_SIZE=8192, 3% null density:
| case | before | after | Δ |
|-------------------------------------|-----------|-----------|--------|
| utf8_view: single, no nulls | 19.11 µs | 17.23 µs | -9.8% |
| utf8_view: multiple, no nulls (3) | 54.13 µs | 53.31 µs | -1.5% |
| utf8_view: single, nulls | 19.62 µs | 19.54 µs | -0.4% |
| utf8_view: multiple, nulls (3) | 58.86 µs | 58.03 µs | -1.4% |
| utf8_view (small): single, no nulls | 2.55 µs | 2.25 µs | -11.6% |
| utf8_view (small): multiple, no | 9.77 µs | 8.47 µs | -13.3% |
| utf8_view (small): single, nulls | 6.91 µs | 3.65 µs | -47.2% |
| utf8_view (small): multiple, nulls | 20.43 µs | 10.18 µs | -50.2% |1 parent 5134a1a commit 3c4b8df
1 file changed
Lines changed: 271 additions & 97 deletions
0 commit comments