Refactor/bits eq unify - #12
Conversation
Replace eq_words + eq_words_shifted with a unified eq_words(shift) that dispatches internally based on the intra-word shift: - shift == 0 → funcs_for_eq_words_aligned_core - shift != 0 → funcs_for_eq_words_unaligned_core Renames: - funcs_for_eq_words_core → funcs_for_eq_words_aligned_core - funcs_for_eq_words_shifted_core → funcs_for_eq_words_unaligned_core Removes the redundant shift==0 check from call sites. Callers now pass shift=0 for aligned comparisons. bits_equal_at also drops its outer SMALL_WORDS gate, delegating that decision to the trait methods. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: DeepSeek AI <service@deepseek.com>
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: DeepSeek AI <service@deepseek.com>
Change eq_words parameter from shift to offset. The trait impl now computes shift = offset % WORD_BITS, base = offset / WORD_BITS, and slices internally. Callers pass the raw bit offset. bits_equal_at drops its shift/base_word/sw computation. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: DeepSeek AI <service@deepseek.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Merging this PR will improve performance by 11%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | find/len_65/front/bit_string |
1.4 µs | 1.3 µs | +11.55% |
| ⚡ | strip_prefix/len_65536/miss/bit_string |
616.7 ns | 558.3 ns | +10.45% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing refactor/bits-eq-unify (446756e) with main (59a8f81)
Footnotes
-
11 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. ↩
No description provided.