Benchmarks and internal tuning tools for ojAlgo linear algebra operations, using JMH (Java Microbenchmark Harness).
This project serves two purposes:
Comparing ojAlgo linear algebra operations against alternative Java libraries:
| Library | Why it's included |
|---|---|
| EJML | Pure Java, no dependencies, high performance. Top quality pure Java alternative. |
| MTJ | Wraps BLAS/LAPACK via netlib-java, automatically switching between Java and native code. On macOS it defaults to Apple's vecLib. Included as a native code performance reference. |
| Apache Commons Math | The only linear algebra library backed by a large organisation (Apache). A baseline that alternatives must justify improving upon. |
Benchmark classes in org.ojalgo.benchmark.lab cover: matrix multiplication, addition, scaling, transpose, decompositions (EVD, SVD, Cholesky), solvers (general, Hermitian, least squares), inversion, determinant, and pseudoinverse.
Benchmarks used to tune ojAlgo's internal implementation parameters:
- Threshold tuners (
org.ojalgo.matrix.operation) -- determine at what matrix size operations should switch between serial and parallel execution, and between different multiplication strategies. - Parallelism tuners (
org.ojalgo.matrix.operation) -- find the optimal degree of parallelism for various matrix operations and Householder transformations. - Decomposition tuners (
org.ojalgo.matrix.decomposition) -- compare implementation variants (primitive vs raw arrays) for Cholesky, LU, QR, Eigenvalue, SVD, and Tridiagonal decompositions, and benchmark sparse LU operations. - Array operation tuners (
org.ojalgo.array.operation) -- tune DOT product unrolling, AXPY ordering, and norm calculations. - Other -- DFT benchmarks, number parsing benchmarks, special function benchmarks, sparse array performance, and solver strategy selection.
mvn clean installRun a specific benchmark:
java -jar target/ojlab.jar org.ojalgo.benchmark.lab.FillByMultiplyingReplace FillByMultiplying with whichever benchmark you want to run. Use -l to list all available benchmarks:
java -jar target/ojlab.jar -lBenchmark results are published at: https://www.ojalgo.org/category/benchmarks/