Integer vs IntBox benchmark

Remi Forax forax at univ-mlv.fr
Tue Jun 26 22:46:31 UTC 2018


I've just written a small perf benchmark [1] that compare int, Integer and IntBox (a value type that stores an int) and results are very good. 

On my laptop:
Benchmark                    Mode  Cnt  Score    Error  Units
IntBoxBenchMark.sum_IntBox   avgt   15  0.029 ±  0.001  ms/op
IntBoxBenchMark.sum_Integer  avgt   15  0.523 ±  0.011  ms/op
IntBoxBenchMark.sum_int      avgt   15  0.029 ±  0.001  ms/op


On travisCI (amazon ec2 i think):
Benchmark                    Mode  Cnt  Score    Error  Units
IntBoxBenchMark.sum_IntBox   avgt   15  0.035 ±  0.001  ms/op
IntBoxBenchMark.sum_Integer  avgt   15  0.724 ±  0.039  ms/op
IntBoxBenchMark.sum_int      avgt   15  0.035 ±  0.001  ms/op

Rémi

[1] https://github.com/forax/valuetype-lworld/blob/master/src/test/java/fr.umlv.valuetype/fr/umlv/valuetype/perf/IntBoxBenchMark.java


More information about the valhalla-dev mailing list