-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Don't use totality when defining the (potentially) partial order relation <= #22027
Conversation
test/operators.jl
Outdated
@@ -97,3 +97,15 @@ end | |||
B = 3 .> [1 -1 5] .> 0 | |||
@test B == [true false false] | |||
end | |||
|
|||
Base.:(<)(x::Type, y::Type) = (x <: y) & (x != y) |
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.
I think this should be wrapped in a custom type e.g. struct SortType x end
. While no other test should be relying on this, there could be future interference should another test want to do something similar.
Potentially it's 2 comparisons vs 1. What would nanosoldier say? |
For integers, the generated code is very similar, but why guess when you can just ask @nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels |
This came up on discourse: https://discourse.julialang.org/t/behavior-of-when-isless-or-is-defined/10114. Looking at it again, I'm wondering what the motivation for the change was. As a general fallback since even if this doesn't cause a performance problem for built-in types, user-defined types may have expensive |
The main motivation was correctness. We state that Just thinking out loud a possible alternative: my impression is that the |
I do agree that |
No description provided.