Skip to content

A project template for running micro-benchmarks of openLCA core functions.

Notifications You must be signed in to change notification settings

msrocka/olca-benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A project template for running micro-benchmarks of openLCA core functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published