Skip to content

Read pHash entries once per matching run and compare them together - #323

Merged
abrignoni merged 1 commit into
mainfrom
fix/phash-match-once
Oct 30, 2026
Merged

abrignoni merged 1 commit into
mainfrom
fix/phash-match-once

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Known-hash matching now reads the pHash entries once per run and compares them together, instead of re-reading and looping over all of them for every file with no exact hit.

  • 16,000 files against 10,000 pHash entries: 189.3 s before, 1.1 s after. With 100,000 entries: 4.3 s.
  • Hits are unchanged. A test checks the new comparison against the old loop on odd value shapes, every threshold and the Project VIC switch, and fails on three broken variants.
  • Measured on synthetic data only.

🤖 Generated with Claude Code

Matching read every perceptual-hash entry again for each file with no exact
hit and compared them one at a time, so a run cost files x entries. On a
16,000-file case with 10,000 pHash entries it took 189.3 s; now 1.1 s, and
4.3 s with 100,000. Hits are the ones the old loop found: a test compares
both over odd value shapes, thresholds and the Project VIC switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit e3c2ba5 into main Oct 30, 2026
7 checks passed
@abrignoni
abrignoni deleted the fix/phash-match-once 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