Conversation
This should prioritize entries that have been retreived.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a bounded cache to the deduplication table to prevent unbounded memory growth. The implementation replaces the unbounded sync.Map with a bounded LRU cache from the github.com/maypok86/otter library, with a default size limit of 1 million entries.
Changes:
- Replaced
sync.Mapwithotter.Cache[string, revisitRecord]for bounded deduplication storage - Added
DedupeCacheSizeconfiguration option toDedupeOptions - Updated API calls from
Load/Storeto type-safeGet/Setmethods, eliminating type assertions - Added proper cache cleanup in
Close()method
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client.go | Added otter cache import, changed dedupeHashTable type to otter.Cache, implemented cache initialization with default 1M size, added closeDedupeCache cleanup function |
| dedupe.go | Added DedupeCacheSize field to DedupeOptions, updated checkLocalRevisit to use type-safe Get() method, removed minor trailing whitespace |
| dialer.go | Updated Store call to Set for storing dedupe entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
willmhowes
approved these changes
Feb 3, 2026
Collaborator
willmhowes
left a comment
There was a problem hiding this comment.
Looks good! Have one question, primarily for my own understanding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should ensure that we don't grow infinitely 😅 Default is 1M which seems sane.