summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-01-21 19:36:09 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-01-21 19:36:09 +0100
commit850acefbc85b8bfdf0d6a434e8659f0461cc44bd (patch)
tree15a2102438142280efa5fe14c002604c7af31abc /vespajlib
parent718b455587a6e093abfdbe5a45dc40221abc90eb (diff)
Reorder tests as the indexed tests varies a lot when they are run last. Reason not known.
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java56
1 files changed, 31 insertions, 25 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
index 5c4d5f1ffcf..37c0fb87be0 100644
--- a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
+++ b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
@@ -107,45 +107,51 @@ public class TensorFunctionBenchmark {
public static void main(String[] args) {
double time = 0;
- // ---------------- Mapped with extra space (sidesteps current special-case optimizations):
- // 7.8 ms
- time = new TensorFunctionBenchmark().benchmark(1000, vectors(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, true);
- System.out.printf("Mapped vectors, x space time per join: %1$8.3f ms\n", time);
- // 7.7 ms
- time = new TensorFunctionBenchmark().benchmark(1000, matrix(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, true);
- System.out.printf("Mapped matrix, x space time per join: %1$8.3f ms\n", time);
+ // ---------------- Indexed unbound:
+ time = new TensorFunctionBenchmark().benchmark(50000, vectors(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, false);
+ System.out.printf("Indexed unbound vectors, time per join: %1$8.3f ms\n", time);
+ time = new TensorFunctionBenchmark().benchmark(50000, matrix(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, false);
+ System.out.printf("Indexed unbound matrix, time per join: %1$8.3f ms\n", time);
+
+ // ---------------- Indexed bound:
+ time = new TensorFunctionBenchmark().benchmark(50000, vectors(100, 300, TensorType.Dimension.Type.indexedBound), TensorType.Dimension.Type.indexedBound, false);
+ System.out.printf("Indexed bound vectors, time per join: %1$8.3f ms\n", time);
+
+ time = new TensorFunctionBenchmark().benchmark(50000, matrix(100, 300, TensorType.Dimension.Type.indexedBound), TensorType.Dimension.Type.indexedBound, false);
+ System.out.printf("Indexed bound matrix, time per join: %1$8.3f ms\n", time);
// ---------------- Mapped:
- // 2.1 ms
time = new TensorFunctionBenchmark().benchmark(5000, vectors(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, false);
System.out.printf("Mapped vectors, time per join: %1$8.3f ms\n", time);
- // 7.0 ms
+
time = new TensorFunctionBenchmark().benchmark(1000, matrix(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, false);
System.out.printf("Mapped matrix, time per join: %1$8.3f ms\n", time);
// ---------------- Indexed (unbound) with extra space (sidesteps current special-case optimizations):
- // 14.5 ms
time = new TensorFunctionBenchmark().benchmark(500, vectors(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, true);
System.out.printf("Indexed vectors, x space time per join: %1$8.3f ms\n", time);
- // 8.9 ms
time = new TensorFunctionBenchmark().benchmark(500, matrix(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, true);
System.out.printf("Indexed matrix, x space time per join: %1$8.3f ms\n", time);
- // ---------------- Indexed unbound:
- // 0.14 ms
- time = new TensorFunctionBenchmark().benchmark(50000, vectors(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, false);
- System.out.printf("Indexed unbound vectors, time per join: %1$8.3f ms\n", time);
- // 0.44 ms
- time = new TensorFunctionBenchmark().benchmark(50000, matrix(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, false);
- System.out.printf("Indexed unbound matrix, time per join: %1$8.3f ms\n", time);
+ // ---------------- Mapped with extra space (sidesteps current special-case optimizations):
+ time = new TensorFunctionBenchmark().benchmark(1000, vectors(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, true);
+ System.out.printf("Mapped vectors, x space time per join: %1$8.3f ms\n", time);
+ time = new TensorFunctionBenchmark().benchmark(1000, matrix(100, 300, TensorType.Dimension.Type.mapped), TensorType.Dimension.Type.mapped, true);
+ System.out.printf("Mapped matrix, x space time per join: %1$8.3f ms\n", time);
+
+ /** 2.4Ghz Intel Core i9, Macbook Pro 2019
+ * Indexed unbound vectors, time per join: 0,067 ms
+ * Indexed unbound matrix, time per join: 0,107 ms
+ * Indexed bound vectors, time per join: 0,068 ms
+ * Indexed bound matrix, time per join: 0,105 ms
+ * Mapped vectors, time per join: 1,780 ms
+ * Mapped matrix, time per join: 5,339 ms
+ * Indexed vectors, x space time per join: 6,398 ms
+ * Indexed matrix, x space time per join: 3,220 ms
+ * Mapped vectors, x space time per join: 13,026 ms
+ * Mapped matrix, x space time per join: 28,259 ms
+ */
- // ---------------- Indexed bound:
- // 0.32 ms
- time = new TensorFunctionBenchmark().benchmark(50000, vectors(100, 300, TensorType.Dimension.Type.indexedBound), TensorType.Dimension.Type.indexedBound, false);
- System.out.printf("Indexed bound vectors, time per join: %1$8.3f ms\n", time);
- // 0.44 ms
- time = new TensorFunctionBenchmark().benchmark(50000, matrix(100, 300, TensorType.Dimension.Type.indexedBound), TensorType.Dimension.Type.indexedBound, false);
- System.out.printf("Indexed bound matrix, time per join: %1$8.3f ms\n", time);
}
}