-
Notifications
You must be signed in to change notification settings - Fork 323
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
sort handles incomparable values #5998
Conversation
31398a0
to
c6e673a
Compare
Will be used in another node with @GenerateUncached.
3fa7403
to
23c0dbf
Compare
23c0dbf
to
b5692b8
Compare
# Conflicts: # distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso # distribution/lib/Standard/Base/0.0.0-dev/src/Data/Ordering.enso # test/Tests/src/Data/Numbers_Spec.enso # test/Tests/src/Data/Ordering_Spec.enso
432a87b
to
219aa4a
Compare
cb93987
to
4fbdc0d
Compare
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Show resolved
Hide resolved
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Show resolved
Hide resolved
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Show resolved
Hide resolved
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'll appreciate applying the two suggestions. Other than that - it all looks very good! I'm glad vector sort will be improved now. And I really appreciate very good unit tests.
a2c6cd0
to
30109e1
Compare
30109e1
to
8268e02
Compare
Scheduled benchmarks in https://github.com/enso-org/enso/actions/runs/4702222179. I have checked
|
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.
- Use
alter
in theVector_Spec.enso
- Don't forget to convert interop values with
HostToEnsoValueNode
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Ordering.enso
Outdated
Show resolved
Hide resolved
@@ -113,6 +113,8 @@ private Value createEnsoMethod(String source, String methodName) { | |||
@Test | |||
public void recursiveFactorialCall() { | |||
final Value facFn = createEnsoMethod(""" | |||
from Standard.Base.Data.Ordering import all | |||
|
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.
Without this import we cannot use <=
anymore.
- result of 0df66b1
- also reported as Comparison operators should not require importing Standard.Base.Any module #5610
...ntime/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortArrayNode.java
Show resolved
Hide resolved
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Outdated
Show resolved
Hide resolved
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Show resolved
Hide resolved
...time/src/main/java/org/enso/interpreter/node/expression/builtin/ordering/SortVectorNode.java
Outdated
Show resolved
Hide resolved
This reverts commit 0df66b1.
Benchmark resultsBaseline from develop: I had to revert 0df66b1 ("Remove the remaining comparison operator overrides for numbers"), as that caused a huge performance regressions on benchmarks dealing with vectors with primitive values. This commit was not essential for this PR, and we can deal with it later. After the revert, I tried running and comparing some benchmarks locally. Comparison of my recent version (254d579) with the baseline is:
ConclusionOverall, the benchmark results seem pretty good. Sorting of vector with primitive values is roughly the same, but we can see huge improvements for sorting of vector with some atoms (-64%) and dates (-36%). Will merge this PR ASAP.
|
- Output table is sorted by benchmark labels. - Do not fail when there are different benchmark labels in both runs.
# Conflicts: # test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso
eca0069
to
1f23d83
Compare
Fixes #5742
Pull Request Description
Vector.sort
handles incomparable values. Now, it should sort basically any vector, potentially attaching a warning ifsort
encountered incomparable values.Important Notes
Vector.sort
method signatureVector.sort_builtin
optimized builtin for the most common case - sorting only primitive values withDefault_Comparator
.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.