Skip to content

perf: halve resolver-worker page cache + reuse near-dup shingle sets - #561

Merged
bompus merged 2 commits into
fork/consolidatedfrom
perf/resolver-worker-cache
Oct 27, 2026
Merged

bompus merged 2 commits into
fork/consolidatedfrom
perf/resolver-worker-cache

Conversation

@bompus

@bompus bompus commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

Two measured follow-ups to the resolver-pool work, stacked on the merged #558/#559/#560 tower:

  • Halve the resolver-worker SQLite page cache (cache_size 32 → 16 MiB): reclaims ~200 MB of index-time RSS across the 12-worker pool. Benchmarked time-neutral (pretix-Bun 7.72 s vs 8.67 s baseline run, same-order variance).
  • Reuse shingle sets between near-duplicate signing and pair scoring: refreshNearDuplicates tokenized + shingled every changed body to MinHash-sign it, then pairNearDuplicates re-tokenized the same bodies to score pairs — ~9,200 duplicate tokenizations on pretix. A freshSets map now hands the sign-time Set to scoring. Near-duplicate phase on pretix: 458 → 284 ms (−38%), identical pairs and scores.

Test plan

  • __tests__/near-duplicates.test.ts: 9/9 pass
  • __tests__/resolver-pool-sizing.test.ts + __tests__/resolver-pool-engage.test.ts: green
  • Build/typecheck clean
  • Instrumented pretix index: nearDuplicates phase 458 → 284 ms; identical pair output

Each of the up-to-12 pool workers held a 32 MiB SQLite page cache —
~384 MiB summed inside the main process before any real working set.
The workers do scattered point reads during resolution; -16384 (16 MiB)
measured peak-RSS neutral-to-better on pretix (4.34 vs 4.24 GiB main)
with identical-or-better wall time.
Every body in a candidate pair was tokenized and shingled twice: once to
write its MinHash signature, again to score the pair's exact Jaccard.
Keep the Set computed at sign time and hand it to the pair pass — on
pretix the phase drops ~38% (458 -> 284 ms); identical pairs, identical
scores.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e28058d and c6a0672.

Files selected for processing: 2
  • src/graph/near-duplicates.ts
  • src/resolution/resolver-worker.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bompus

bompus commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bompus
bompus merged commit 891e196 into fork/consolidated Oct 27, 2026
1 check passed
@bompus
bompus deleted the perf/resolver-worker-cache branch October 27, 2026 20:57
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