Skip to content

Repository files navigation

ojAlgo Linear Algebra Benchmark (ojLAB)

Benchmarks and internal tuning tools for ojAlgo linear algebra operations, using JMH (Java Microbenchmark Harness).

What's in here

This project serves two purposes:

Library comparison benchmarks

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.

Internal tuning benchmarks

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.

Building and running

mvn clean install

Run a specific benchmark:

java -jar target/ojlab.jar org.ojalgo.benchmark.lab.FillByMultiplying

Replace FillByMultiplying with whichever benchmark you want to run. Use -l to list all available benchmarks:

java -jar target/ojlab.jar -l

Results

Benchmark results are published at: https://www.ojalgo.org/category/benchmarks/

About

oj! Linear Algebra Benchmark

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages