Repository navigation
refactor(xor): simplify construction and focus benchmark workloads - #325
Conversation
Focused XOR benchmark resultsThis refactor keeps construction and query performance near the preceding revision; it does not claim a new broad speedup. The matrix now covers 45 scenarios / 93 implementation rows per profile, replacing the forced-retry and adjacent-cardinality cases with representative build sizes. Deduplicating comparisons include the same collect/sort/deduplicate work on both sides and use repeated values. Counts below mean lower / equal / higher elapsed-time medians versus xorf. They are not statistical wins or an aggregate score.
The default-seed 16K distinct builds still need an extra attempt and remain slower. LTO also has seven query medians 1.0%–2.2% above xorf; six of those seven sample ranges overlap. Exact remaining gaps are listed below alongside all results. The changed build definitions establish a new baseline: improvements relative to xorf in the deduplicating rows must not be interpreted as before/after speedups caused by the refactor. Both profiles use optimized Cargo bench builds with five repeats, fixed rounds, and setup/cleanup included. Apple M4 Max, macOS arm64, rustc 1.101.0-nightly (8006091eb, 2026-10-17), xorf 0.13.0. Measured production and benchmark code: Reproduction and before/after checks
Before/after checks used identical retained benchmark definitions on Every remaining above-xorf median
All measurements and raw samples (ms)Delta = (DataSketches median / xorf median − 1) × 100%; negative means less elapsed time. Each scenario keeps identical work and rounds across implementations. Ordinary bench
Fat LTO, one codegen unit
|
XOR construction repeats fingerprint allocation and assignment for each width, while the benchmark matrix emphasizes adjacent cardinalities and a specially selected retry input. Share fingerprint allocation with assignment, centralize the validated 32-bit range conversion, and remove the builder forwarding method used only to expose an attempt limit to tests.
Keep retry, order-independence, empty-filter, and compatibility coverage at their existing behavior boundaries while removing overlapping assertions and tests. Replace the matched-retry performance matrix with small, shard-sized, and large builds; retain independent-filter batches and imported-filter queries. Deduplicating comparisons now use repeated values and include the sorting and deduplication required by xorf's caller, so both sides perform equivalent work.
Validation:
cargo x check,cargo x test(815 tests),cargo x lint(identical clean source copy), andcargo x bench -- --test(246 implementation/workload combinations). Optimized before/after spot checks show similar construction and query timings; this change does not claim a new broad speedup.The complete benchmark results include ordinary bench and fat LTO, all raw samples, and the remaining slower cases.