mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-29 08:51:53 +00:00
Sorts memories by created_at and uses an early exit condition in the inner loop to avoid checking all pairs. This reduces complexity from O(N^2) to roughly O(N * k) where k is the number of items within the duplicate window. Measured improvement for 30k items: ~2.1s -> ~0.25s (8x speedup). Co-authored-by: PR0M3TH3AN <[email protected]>