Skip to content

5.0. Benchmark

Fabio Lima edited this page Oct 15, 2023 · 15 revisions

Benchmark

This section shows benchmarks for:

  • java.util.UUID;
  • ./src/.../alt/GUID.java;
  • ./src/.../UuidCreator.java.

Benchmark environment provided by Github Actions as specified in ./.github/workflows/benckmark.yml.

To execute the benchmark on your local machine, run ./benchmark/run.sh.

Throughput with 4 threads on JDK 8

-----------------------------------------------------------------------------
Benchmark                          Mode  Cnt       Score      Error   Units
-----------------------------------------------------------------------------
Throughput.altGUIDFromString      thrpt    5   23956.562 ± 1275.122  ops/ms
Throughput.altGUIDToString        thrpt    5    4856.311 ±  263.480  ops/ms
Throughput.altGUIDv1              thrpt    5   37159.851 ± 2937.331  ops/ms
Throughput.altGUIDv3              thrpt    5    3220.306 ±  130.254  ops/ms
Throughput.altGUIDv4              thrpt    5  158275.481 ± 4692.207  ops/ms
Throughput.altGUIDv5              thrpt    5    2595.631 ±  154.530  ops/ms
Throughput.altGUIDv6              thrpt    5   38509.952 ± 1583.123  ops/ms
Throughput.altGUIDv7              thrpt    5   45379.955 ± 2499.478  ops/ms
-----------------------------------------------------------------------------
Throughput.jdkUUIDFromString      thrpt    5    3195.253 ±  153.360  ops/ms
Throughput.jdkUUIDToString        thrpt    5    4993.072 ±  193.616  ops/ms
Throughput.jdkUUIDv3              thrpt    5    3754.799 ±   93.805  ops/ms
Throughput.jdkUUIDv4              thrpt    5    1211.930 ±   95.383  ops/ms
-----------------------------------------------------------------------------
Throughput.uuidCreatorFromString  thrpt    5   27386.782 ± 1976.176  ops/ms
Throughput.uuidCreatorToString    thrpt    5   33069.242 ± 1722.242  ops/ms
Throughput.uuidCreatorV1          thrpt    5    9707.480 ±  157.684  ops/ms
Throughput.uuidCreatorV3          thrpt    5    3770.318 ±  603.189  ops/ms
Throughput.uuidCreatorV4          thrpt    5    1517.354 ±  218.455  ops/ms
Throughput.uuidCreatorV5          thrpt    5    2950.117 ±  145.772  ops/ms
Throughput.uuidCreatorV6          thrpt    5    9668.325 ±  367.878  ops/ms
Throughput.uuidCreatorV7          thrpt    5    2173.835 ±   83.803  ops/ms
-----------------------------------------------------------------------------
Total time: 00:06:50
-----------------------------------------------------------------------------

Throughput with 4 threads on JDK 21

-----------------------------------------------------------------------------
Benchmark                          Mode  Cnt       Score       Error   Units 
-----------------------------------------------------------------------------
Throughput.altGUIDFromString      thrpt    5   23158.777 ±  1821.198  ops/ms
Throughput.altGUIDToString        thrpt    5   65180.461 ±  6017.142  ops/ms
Throughput.altGUIDv1              thrpt    5   36232.100 ±  2389.162  ops/ms
Throughput.altGUIDv3              thrpt    5   10586.596 ±   591.769  ops/ms
Throughput.altGUIDv4              thrpt    5  179180.825 ± 10367.188  ops/ms
Throughput.altGUIDv5              thrpt    5    5706.582 ±   639.636  ops/ms
Throughput.altGUIDv6              thrpt    5   36542.028 ±  1225.564  ops/ms
Throughput.altGUIDv7              thrpt    5   50620.045 ±  3424.101  ops/ms
-----------------------------------------------------------------------------
Throughput.jdkUUIDFromString      thrpt    5   74853.840 ±  5154.535  ops/ms
Throughput.jdkUUIDToString        thrpt    5   65793.002 ±  4664.671  ops/ms
Throughput.jdkUUIDv3              thrpt    5   10953.302 ±   690.206  ops/ms
Throughput.jdkUUIDv4              thrpt    5    1387.702 ±    88.053  ops/ms
-----------------------------------------------------------------------------
Throughput.uuidCreatorFromString  thrpt    5   36104.613 ±  2270.606  ops/ms
Throughput.uuidCreatorToString    thrpt    5   64112.702 ±  3592.804  ops/ms
Throughput.uuidCreatorV1          thrpt    5    9952.752 ±    77.387  ops/ms
Throughput.uuidCreatorV3          thrpt    5   10462.576 ±  1273.508  ops/ms
Throughput.uuidCreatorV4          thrpt    5    1969.693 ±    84.694  ops/ms
Throughput.uuidCreatorV5          thrpt    5    5790.544 ±   383.018  ops/ms
Throughput.uuidCreatorV6          thrpt    5    9946.889 ±    24.111  ops/ms
Throughput.uuidCreatorV7          thrpt    5    2937.646 ±   288.790  ops/ms
-----------------------------------------------------------------------------
Total time: 00:06:49
-----------------------------------------------------------------------------

Note: JDK performance may have improved after this benchmark was published. Make your own performance measurements by running the provided benchmark code.

Clone this wiki locally