aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-12-19 15:55:17 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2016-12-19 15:55:17 +0100
commit120b42f1e7f1fa0ce4b34a6e0956d52a62ca6aff (patch)
tree73bba5576289cbf87bb34e4cfab25e0c4dc7c8f9 /vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
parent2959b5aefb258cf320f375f63a6555441fd0aa51 (diff)
Split iterating into subspaces for performance
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java')
-rw-r--r--vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
index bbab92fc16d..a450e3ec9e7 100644
--- a/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
+++ b/vespajlib/src/test/java/com/yahoo/tensor/TensorFunctionBenchmark.java
@@ -117,12 +117,12 @@ public class TensorFunctionBenchmark {
// - After adding type: 300 ms
// - After sorting dimensions: 100 ms
// - After special-casing single space: 2.4 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);
+ //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
- 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);
+ //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
@@ -139,21 +139,25 @@ public class TensorFunctionBenchmark {
// - 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.1 ms
- time = new TensorFunctionBenchmark().benchmark(10000, vectors(100, 300, TensorType.Dimension.Type.indexedUnbound), TensorType.Dimension.Type.indexedUnbound, false);
+ // - After double-array backing: 0.09 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: 10 ms
+ // - After moving to iterators: 7.7 ms
+ // - After indexed subspace join algorithm: 6
+ // - After passing sized: 3.7 ms
time = new TensorFunctionBenchmark().benchmark(500, 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.1 ms
- time = new TensorFunctionBenchmark().benchmark(10000, vectors(100, 300, TensorType.Dimension.Type.indexedBound), TensorType.Dimension.Type.indexedBound, false);
+ // Initial: 0.09 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: 10 ms
+ // - After moving to iterators: 7.7 ms
+ // - After indexed subspace join algorithm: 6
+ // - After passing sized: 3.7 ms
time = new TensorFunctionBenchmark().benchmark(500, 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);