Skip to content

Refactor/bits eq unify - #12

Merged
jcfangc merged 3 commits into
mainfrom
refactor/bits-eq-unify
Jun 21, 2026
Merged

Refactor/bits eq unify#12
jcfangc merged 3 commits into
mainfrom
refactor/bits-eq-unify

Conversation

@jcfangc

@jcfangc jcfangc commented Jun 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

jcfangc and others added 3 commits June 21, 2026 04:15
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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...raits/bits_eq/funcs_for_eq_words_unaligned_core.rs 40.00% 3 Missing ⚠️
..._string/impls_for_matching/impls_for_matches_at.rs 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jun 21, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 98 untouched benchmarks
⏩ 11 skipped benchmarks1

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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.

@jcfangc
jcfangc merged commit 5ea7b64 into main Jun 21, 2026
7 checks passed
@jcfangc
jcfangc deleted the refactor/bits-eq-unify branch June 21, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants