summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java47
1 files changed, 10 insertions, 37 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
index 9b34780a6fc..56787dddbde 100644
--- a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
+++ b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
@@ -105,71 +105,44 @@ public class TensorFunctionBenchmark {
double time;
// ---------------- Mapped with extra space (sidesteps current special-case optimizations):
- // Initial: 450 ms
- // - Now: 350 ms
+ // 420 ms
time = new TensorFunctionBenchmark().benchmark(20, 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);
- // Initial: 900 ms
- // - Now: 700 ms
+ // 770 ms
time = new TensorFunctionBenchmark().benchmark(20, 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);
// ---------------- Mapped:
- // Initial: 150 ms
- // - After adding type: 300 ms
- // - After sorting dimensions: 100 ms
- // - After special-casing single space: 2.4 ms
+ // 2.7 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);
- // Initial: 760 ms
- // - After special-casing subspace: 13 ms
- // - Now: 7 ms
+ // 7 ms
time = new TensorFunctionBenchmark().benchmark(500, 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):
- // Initial: 1900 ms
- // - After moving to cell iterators: 1100
- // - Now: 1300
+ // 1700 ms
time = new TensorFunctionBenchmark().benchmark(20, 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);
- // Initial: 2200 ms
- // - After moving to cell iterators: 1300
- // - Now: 1550
+ // 1900 ms
time = new TensorFunctionBenchmark().benchmark(20, 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:
- // Initial: 718 ms
- // - After special casing join: 3.6 ms
- // - After special-casing reduce: 0.80 ms
- // - After create IndexedTensor without builder: 0.4 ms
- // - After double-array backing: 0.09 ms
+ // 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);
- // Initial: 3500 ms
- // - After special-casing subspace: 25 ms
- // - After moving to iterators: 7.7 ms
- // - After indexed subspace join algorithm: 6
- // - After passing sized: 3.7 ms
- // - After creating int tensor address: 2.5 ms
- // - After using int address to get ints directly: 0.93 ms
+ // 0.89 ms
time = new TensorFunctionBenchmark().benchmark(5000, 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:
- // Initial: 0.09 ms
+ // 0.14 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);
- // Initial: 25 ms
- // - After moving to iterators: 7.7 ms
- // - After indexed subspace join algorithm: 6
- // - After passing sized: 3.7 ms
- // - After creating int tensor address: 2.8 ms
- // - After using int address to get ints directly: 0.93 ms
+ // 0.88 ms
time = new TensorFunctionBenchmark().benchmark(5000, 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);
-
}
}