Skip to content

Compare each near-duplicate bucket's pairs together - #324

Merged
abrignoni merged 1 commit into
mainfrom
fix/group-pairs-numpy
Oct 30, 2026
Merged

abrignoni merged 1 commit into
mainfrom
fix/group-pairs-numpy

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Near-duplicate grouping now compares each pHash bucket's pairs together with numpy, instead of one pair at a time.

  • One call: 0.9 s to 0.13 s on 16,000 files, 224.6 s to 10.8 s on 218,000. Processing makes two calls.
  • Groups are unchanged. A test checks against the old loop, including a bucket over the 1,500 cap, and regrouping a 16,000-file case changed none of its rows.
  • The cap itself is untouched. Pairs that meet only in a skipped bucket are still never compared; that is a separate change.

🤖 Generated with Claude Code

Grouping compared the pairs in each pHash bucket one at a time in Python, and
a bucket holds about n/256 files, so the time grew with the square of the
case: one call took 0.9 s on 16,000 files and 224.6 s on 218,000. Now 0.13 s
and 10.8 s. The groups are the same: a test compares both on near copies,
missing dHashes, wide hashes and a bucket over the cap, and regrouping a
16,000-file case changed none of its 16,000 rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit 8ff6416 into main Oct 30, 2026
7 checks passed
@abrignoni
abrignoni deleted the fix/group-pairs-numpy branch October 31, 2026 01:49
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.

1 participant