[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

@@ -6,15 +6,10 @@ import org.openjdk.jmh.annotations.*;
import static org.assertj.core.api.Assertions.assertThat;
@BenchmarkMode(Mode.AverageTime)
@Fork(value = 2)
@Warmup(iterations = 5)
@Measurement(iterations = 10)
public class SimpleMatrixUnitTest {
class SimpleMatrixUnitTest {
@Test
@Benchmark
public void givenTwoMatrices_whenMultiply_thenMultiplicatedMatrix() {
void givenTwoMatrices_whenMultiply_thenMultiplicatedMatrix() {
SimpleMatrix firstMatrix = new SimpleMatrix(
new double[][] {
new double[] {1d, 5d},
@@ -43,4 +38,4 @@ public class SimpleMatrixUnitTest {
assertThat(actual).matches(m -> m.isIdentical(expected, 0d));
}
}
}