-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unwrap
1.11 regression + performance improvements
#576
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #576 +/- ##
==========================================
- Coverage 97.84% 97.81% -0.04%
==========================================
Files 19 19
Lines 3249 3243 -6
==========================================
- Hits 3179 3172 -7
- Misses 70 71 +1 ☔ View full report in Codecov by Sentry. |
dcf4eeb
to
251b257
Compare
251b257
to
270654c
Compare
update docs for rng
shorten `merge_groups!` again
270654c
to
774aedb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I have a hard time reviewing this PR where cosmetic changes and performance improvements are mixed together.
sort!(edges, alg=MergeSort) | ||
gather_pixels!(pixel_image, edges) | ||
perm = sortperm(map(x -> x.reliability, edges); alg=MergeSort) | ||
edges = edges[perm] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this better? And why the map
? Shouldn't the custom isless
take care of that? And if not, wouldn't a by=
be better by avoiding a temporary array?
The regression affects 1.11 but not 1.10. I think the optimizer fails to simplify
merge_groups
. Aside, this includes a small performance enhancement (replacingsort!
withsortperm
) at the cost of ~40% more memory. Maybe it's worth it.PR
Only fix (similar to 1.10)
Without PR