Performance
Marco Terzer edited this page Nov 11, 2015
·
23 revisions
Pages 7
-
- Results
- Performance Overview
- Multiplication
- Division
- Multiplication/Division by Long-Value
- Double Conversion
- Rounding and Scaling
- All results as CSV file
- Spec
- Running the performance benchmarks on your own machine
- Running all benchmarks with gradle
- Running selected benchmarks
- 1. Compile the jmh-jar file:
- 2a. Run a single test from your IDE, e.g.
- 2b. Run a single test from command line, e.g.
- 2c. Run all benchmarks from command line (simpler with gradle, see above)
Clone this wiki locally
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
Multiplication
Division
Multiplication/Division by Long-Value
Double Conversion
Rounding and Scaling
All results as CSV file
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!