[BAEL-2996] Using OptionsBuilder instead of main method for benchmarking

This commit is contained in:
dupirefr
2019-08-16 09:44:25 +02:00
parent 3897ea7bc4
commit a7a7e6ce9c
10 changed files with 154 additions and 52 deletions

View File

@@ -0,0 +1,33 @@
package com.baeldung.matrices;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
@State(Scope.Benchmark)
public class MatrixProvider {
private double[][] firstMatrix;
private double[][] secondMatrix;
public MatrixProvider() {
firstMatrix =
new double[][] {
new double[] {1d, 5d},
new double[] {2d, 3d},
new double[] {1d ,7d}
};
secondMatrix =
new double[][] {
new double[] {1d, 2d, 3d, 7d},
new double[] {5d, 2d, 8d, 1d}
};
}
public double[][] getFirstMatrix() {
return firstMatrix;
}
public double[][] getSecondMatrix() {
return secondMatrix;
}
}