Repository navigation
perf(layout): use fearless_simd for bloom filter block masks - #10325
joseph-isaacs wants to merge 1 commit into
Conversation
Build the split-block bloom filter mask and apply or test it with a fearless_simd `u32x8`, so the per-lane multiply and variable shift lower to `vpmulld`/`vpsllvd` on AVX2 (SSE2 has no variable shift, so the stock x86-64 build could not vectorize `make_mask`). The SIMD level is detected once and cached. The block bits are unchanged, and non-x86 targets and Miri keep the scalar path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZRAJuGZmP4JRrmAbQQqZx Signed-off-by: Claude <noreply@anthropic.com>
Merging this PR will degrade performance by 33.08%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | contains_present[256] |
368.8 µs | 664.8 µs | -44.52% |
| ❌ | Simulation | contains_absent[256] |
368.9 µs | 664.8 µs | -44.51% |
| ❌ | Simulation | insert[256] |
332.5 µs | 575.1 µs | -42.19% |
| ❌ | Simulation | contains_present[32768] |
724.1 µs | 1,020.1 µs | -29.02% |
| ❌ | Simulation | contains_absent[32768] |
727.6 µs | 1,023.5 µs | -28.91% |
| ❌ | Simulation | contains_absent[1048576] |
802.4 µs | 1,098.3 µs | -26.94% |
| ❌ | Simulation | contains_present[1048576] |
803 µs | 1,099 µs | -26.93% |
| ❌ | Simulation | insert[32768] |
687.7 µs | 930.4 µs | -26.09% |
| ❌ | Simulation | insert[1048576] |
766.6 µs | 1,009.3 µs | -24.05% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ji/fearless-simd-layout (aacd0fc) with develop (c6e51ba)
Footnotes
-
518 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. ↩
|
Closing: this adds SIMD to scalar code rather than replacing intrinsics, so it's out of scope for the fearless_simd migration. Generated by Claude Code |
Summary
Part of the fearless_simd migration (see #10319, #10320, #10321). This is one of three per-crate PRs, alongside the
vortex-bufferandvortex-arrayPRs, and contains only switches that benchmarked equal or faster.The split-block bloom filter builds its mask with a per-lane multiply and a per-lane variable shift. SSE2 has no variable shift, so the stock x86-64 build can't vectorize
make_mask. With fearless_simdu32x8these lower tovpmulldandvpsllvdon AVX2.Changes
bloom_filter/partial/mod.rs:add_hashandfind_hashnow go throughblock_insertandblock_containshelpers. On x86_64 these use a fearlessu32x8mask, with the SIMDLeveldetected once in aLazyLock. Other targets and Miri keep the scalarmake_maskpath.make_maskfor 10,000 hashes, including clearing each lane in turn.Benchmarks
In-repo
cargo bench -p vortex-layout --bench bloom_filter, which includes XXH3 hashing. Two alternating runs per side, medians; the host is a 4-vCPU Sapphire Rapids VM, so it is noisy.insert/ 256insert/ 32,768insert/ 1,048,576contains_present/ 256contains_present/ 32,768contains_present/ 1,048,576contains_absent/ 256contains_absent/ 32,768contains_absent/ 1,048,576With fearless forced to its AVX2 level, a standalone per-call benchmark was still 1.2–1.3× faster.
Testing
cargo check -p vortex-layout --all-targetsis clean.cargo test -p vortex-layout --lib -- bloom: 55 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01YZRAJuGZmP4JRrmAbQQqZx
Generated by Claude Code