JMH Benchmark

JMH tests are more precise. The only JMH downside is that it takes time and special skills to run

The below results are calculated for the same operations as basic benchmarks presented before

Results like List_1000_asNative and List_1000_asStream are calculated for the same functionality as List Benchmark test with collection size parameter 1000

Note that absolute ops/sec result is less important, than comparison of two numbers derived asNative and asStream

The source code is on GitHub

Benchmark                          Mode   Cnt        Score   Units

List_10_asNative                   thrpt   48   375643.586   ops/s
List_10_asStream                   thrpt   48  1497508.806   ops/s

List_100_asNative                  thrpt   48     4065.589   ops/s
List_100_asStream                  thrpt   48    40372.327   ops/s

List_1000_asNative                 thrpt   48       50.701   ops/s
List_1000_asStream                 thrpt   48      256.414   ops/s

List_specialized_10_asNative       thrpt   48   292591.524   ops/s
List_specialized_10_asStream       thrpt   48  1484524.008   ops/s

List_specialized_100_asNative      thrpt   48     3054.760   ops/s
List_specialized_100_asStream      thrpt   48    46512.386   ops/s

List_specialized_1000_asNative     thrpt   48       36.144   ops/s
List_specialized_1000_asStream     thrpt   48      290.584   ops/s

Vector_10_asNative                 thrpt   48   571845.090   ops/s
Vector_10_asStream                 thrpt   48  1733126.057   ops/s

Vector_100_asNative                thrpt   48     8616.584   ops/s
Vector_100_asStream                thrpt   48    21723.530   ops/s

Vector_1000_asNative               thrpt   48       94.482   ops/s
Vector_1000_asStream               thrpt   48      229.636   ops/s

Vector_specialized_10_asNative     thrpt   48   432803.893   ops/s
Vector_specialized_10_asStream     thrpt   48  1584791.762   ops/s

Vector_specialized_100_asNative    thrpt   48     5416.417   ops/s
Vector_specialized_100_asStream    thrpt   48    23849.965   ops/s

Vector_specialized_1000_asNative   thrpt   48       55.749   ops/s
Vector_specialized_1000_asStream   thrpt   48      287.352   ops/s

Array_10_asNative                  thrpt   48  1246387.213   ops/s
Array_10_asStream                  thrpt   48  1539601.587   ops/s

Array_100_asNative                 thrpt   48    18910.548   ops/s
Array_100_asStream                 thrpt   48    75220.277   ops/s

Array_1000_asNative                thrpt   48      167.388   ops/s
Array_1000_asStream                thrpt   48      299.785   ops/s

Array_specialized_10_asNative      thrpt   48   377209.817   ops/s
Array_specialized_10_asStream      thrpt   48  3116467.533   ops/s

Array_specialized_100_asNative     thrpt   48     3808.779   ops/s
Array_specialized_100_asStream     thrpt   48   122236.415   ops/s

Array_specialized_1000_asNative    thrpt   48       46.922   ops/s
Array_specialized_1000_asStream    thrpt   48      804.247   ops/s

Buffer_10_asNative                 thrpt   48   467505.960   ops/s
Buffer_10_asStream                 thrpt   48  1853406.436   ops/s

Buffer_100_asNative                thrpt   48     6414.531   ops/s
Buffer_100_asStream                thrpt   48    58908.199   ops/s

Buffer_1000_asNative               thrpt   48       73.136   ops/s
Buffer_1000_asStream               thrpt   48      189.957   ops/s

Buffer_specialized_10_asNative     thrpt   48   306824.485   ops/s
Buffer_specialized_10_asStream     thrpt   48  1959711.225   ops/s

Buffer_specialized_100_asNative    thrpt   48     3528.306   ops/s
Buffer_specialized_100_asStream    thrpt   48    48169.771   ops/s

Buffer_specialized_1000_asNative   thrpt   48       46.496   ops/s
Buffer_specialized_1000_asStream   thrpt   48      646.423   ops/s

Range_specialized_10_asNative      thrpt   48   434885.615   ops/s
Range_specialized_10_asStream      thrpt   48  2861328.963   ops/s

Range_specialized_100_asNative     thrpt   48     4989.518   ops/s
Range_specialized_100_asStream     thrpt   48   127653.013   ops/s

Range_specialized_1000_asNative    thrpt   48       48.050   ops/s
Range_specialized_1000_asStream    thrpt   48      741.093   ops/s