Skip to content

Performance

Marco Terzer edited this page Nov 11, 2015 · 23 revisions

Results

Performance results for the following decimal4j types are given below:

  • Decimal (immutable)
  • MutableDecimal
  • Primitive Decimal (here called native Decimal), see [DecimalArithmetic API](DecimalArithmetic API)

As reference points we also list performance results for

  • Primitive double
  • BigDecimal
Performance Overview

decimal4j performance overview

Multiplication

decimal4j performance overview

Division

decimal4j performance overview

Multiplication/Division by Long-Value

decimal4j performance overview

Double Conversion

decimal4j performance overview

Rounding and Scaling

decimal4j performance overview

All results as CSV file

jmh-results.csv

Spec

The results have been run on our vRoot build server:

  • Linux 3.2.0-4-amd64
  • Debian GNU/Linux 7.9 (wheezy)
  • Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (2 dedicated cores)
  • JDK version 1.8.0_31
  • JMH library version: 1.11.1

Running the performance benchmarks on your own machine

Running all benchmarks with gradle

You can run the complete performance test suite via gradle with

gradle jmh

Note: running the full suite takes approximately 3 hours!

Running selected benchmarks

You can also run a single test as follows:

1. Compile the jmh-jar file:
gradle jmhJar
2a. Run a single test from your IDE, e.g.
java org.decimal4j.jmh.AddBenchmark
2b. Run a single test from command line, e.g.
java -cp build/libs/decimal4j-1.0.1-jmh.jar org.decimal4j.jmh.AddBenchmark
2c. Run all benchmarks from command line (simpler with gradle, see above)
java -cp build/libs/decimal4j-1.0.1-jmh.jar org.decimal4j.jmh.JmhRunner

Note: running the full suite takes approximately 3 hours!