Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.76 KB

README.md

File metadata and controls

46 lines (37 loc) · 1.76 KB

olca-benchmarks

This is a project template for running micro-benchmarks of openLCA core functions. It uses jmh from the OpenJDK project with a pure Maven setup.

Usage

Put your benchmark, e.g. MyBenchmark, in the org.openlca.core.benchmark package (see also the other examples in this package) and run the following Maven command:

mvn clean package exec:java -q -Dbenchmark=MyBenchmark

Or execute the run script in this project:

run MyBenchmark

Examples

Sparse vs. dense matrix-vector functions

Using a plain hash table based implementation in Java for matrix-vector operations can be much faster than calling into an optimized BLAS library (OpenBLAS 64bit; tests with an ecoinvent 3.4 system):

Benchmark                         Mode  Cnt  Score   Error  Units
SparseMVOps.denseMultiplication   avgt    3  0.210 ± 0.019   s/op
SparseMVOps.denseScaling          avgt    3  0.456 ± 0.224   s/op
SparseMVOps.sparseMultiplication  avgt    3  0.035 ± 0.002   s/op
SparseMVOps.sparseScaling         avgt    3  0.038 ± 0.007   s/op

Field access in table scans

For full table scans it can be much faster to access the fields by index (e.g. getLong(int)) instead by name (e.g. getLong(String)). These are results for the exchange table of exiobase:

Benchmark                             Mode  Cnt   Score   Error  Units
ExchangeTableScan.scanByFieldNames    avgt    5  40.594 ± 1.532   s/op
ExchangeTableScan.scanByFieldIndices  avgt    5  10.749 ± 0.833   s/op