Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1027 +/- ##
==========================================
- Coverage 98.87% 98.86% -0.02%
==========================================
Files 32 32
Lines 4728 4741 +13
==========================================
+ Hits 4675 4687 +12
- Misses 53 54 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
agammann
left a comment
There was a problem hiding this comment.
I reproduced a behavior change in the single-list path at head 6fd9ecf with a focused Go test. The inline comment has the input, observed output, and suggested regression coverage.
| case 0: | ||
| return Slice{} | ||
| case 1: | ||
| return Uniq(lists[0]) |
There was a problem hiding this comment.
Uniq retains NaN here, while the previous map-based Intersect omits it because NaN never compares equal to itself. On this head, Intersect([]float64{math.NaN(), 1}) returns [NaN 1]; the base returns [1]. Could this shortcut preserve the existing behavior and add a NaN regression test?
There was a problem hiding this comment.
Thanks, I checked the current head: the single-list path uses intersectLarge again, and the new NaN regression test covers the behavior I raised. That specific concern is addressed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agammann
left a comment
There was a problem hiding this comment.
Targeted re-review: the single-list NaN regression is fixed at the current head, as noted in the inline thread. I have not assessed the separate failing checks or the rest of the performance change.
|
I checked the CI failures on current head |
Summary
Uniqfor single-list intersections and optimize small two-list intersections with a linear scan.Benchmark results
Compared parent
5c6ddcbwith this PR (6fd9ecf) on an Apple M4 / darwin arm64. Each result is the median of 5 runs (-benchtime=300ms).The comparison used the same temporary benchmark harness on both revisions:
go test ./benchmark -run '^$' -bench '^BenchmarkIntersectPREval$' -benchmem -benchtime=300ms -count=5.Validation
go test ./...— passed