-
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
Benchmark EnsoMultiValue and speed it up #11846
Comments
JaroslavTulach
added
p-medium
Should be completed in the next few sprints
-compiler
labels
Dec 12, 2024
4 tasks
Here is a the basic benchmark: diff --git engine/runtime-benchmarks/src/main/java/org/enso/interpreter/bench/benchmarks/semantic/ArrayProxyBenchmarks.java engine/runtime-benchmarks/src/main/java/org/enso/interpreter/bench/benchmarks/semantic/ArrayProxyBenchmarks.java
index 1327a37cee..19acb8eac0 100644
--- engine/runtime-benchmarks/src/main/java/org/enso/interpreter/bench/benchmarks/semantic/ArrayProxyBenchmarks.java
+++ engine/runtime-benchmarks/src/main/java/org/enso/interpreter/bench/benchmarks/semantic/ArrayProxyBenchmarks.java
@@ -42,13 +42,30 @@ public class ArrayProxyBenchmarks {
"""
import Standard.Base.Data.Vector.Vector
import Standard.Base.Data.Array_Proxy.Array_Proxy
+ from Standard.Base import Integer
+
sum arr =
go acc i = if i >= arr.length then acc else
- @Tail_Call go (acc + arr.at i) i+1
+ v = arr.at i
+ sum = acc + v
+ @Tail_Call go sum i+1
go 0 0
+ type Rational
+ Number quotient:Integer fraction:Integer
+
+ Rational.from (that:Integer) = Rational.Number that 1
+
make_vector n =
- Vector.new n (i -> 3 + 5*i)
+ Vector.new n i->
+ r = 3 + 5*i
+ r:Integer
+
+ make_int_rational_vector n =
+ Vector.new n i->
+ r = 3 + 5*i
+ r:Integer&Rational
+
make_computing_proxy n =
Array_Proxy.new n (i -> 3 + 5*i)
make_delegating_proxy n =
@@ -70,6 +87,9 @@ public class ArrayProxyBenchmarks {
case "sumOverVector":
test_builder = "make_vector";
break;
+ case "sumOverMultiIntegerRationalVector":
+ test_builder = "make_int_rational_vector";
+ break;
case "sumOverComputingProxy":
test_builder = "make_computing_proxy";
break;
@@ -94,6 +114,11 @@ public class ArrayProxyBenchmarks {
performBenchmark(matter);
}
+ @Benchmark
+ public void sumOverMultiIntegerRationalVector(Blackhole matter) {
+ performBenchmark(matter);
+ }
+
@Benchmark
public void sumOverComputingProxy(Blackhole matter) {
performBenchmark(matter); It piggy backs on
e.g. the Real benchmark in the PR is just inspired by this diff. |
3 tasks
2 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EnsoMultiValue
with visible and hidden types as introduced by:hasn't been optimized for speed and is known to perform certain operations magnitude slower than regular enso values.
The text was updated successfully, but these errors were encountered: