Skip to content

5.0. Benchmark

Fabio Lima edited this page Sep 25, 2022 · 15 revisions

Benchmark

This section shows benchmarks comparing UuidCreator to UUID.randomUUID().

To execute the benchmark, run benchmark/run.sh.

Throughput with 1 thread

-----------------------------------------------------------------------------------
THROUGHPUT (operations/msec)               Mode  Cnt      Score      Error   Units 
-----------------------------------------------------------------------------------
jdk_uuid_01_to_string                     thrpt    5  42242.156 ± 1905.856  ops/ms (13.18)
jdk_uuid_02_from_string                   thrpt    5  10870.140 ±   66.265  ops/ms ( 3.39)
jdk_uuid_03_random_based                  thrpt    5   3205.758 ±   51.194  ops/ms ( 1.00)
jdk_uuid_04_name_based_md5                thrpt    5   4645.175 ±  129.424  ops/ms ( 1.45)
-----------------------------------------------------------------------------------
uuid_creator_01_to_string                 thrpt    5  45566.999 ± 1211.172  ops/ms (14.21)
uuid_creator_02_from_string               thrpt    5  20642.129 ±  756.414  ops/ms ( 6.44)
uuid_creator_03_random_based              thrpt    5   2993.217 ±    9.390  ops/ms ( 0.93)
uuid_creator_04_prefix_comb               thrpt    5   3979.620 ±   11.752  ops/ms 
uuid_creator_05_short_prefix_comb         thrpt    5   3078.287 ±   20.673  ops/ms
uuid_creator_06_name_based_md5            thrpt    5   4700.702 ±   73.034  ops/ms ( 1.47)
uuid_creator_07_name_based_sha1           thrpt    5   3419.082 ±  137.422  ops/ms
uuid_creator_08_time_based                thrpt    5   9992.830 ±   69.941  ops/ms
uuid_creator_09_time_ordered              thrpt    5   9991.436 ±   81.034  ops/ms
uuid_creator_10_time_ordered_epoch        thrpt    5   5337.464 ±   93.906  ops/ms
uuid_creator_11_time_ordered_epoch_plus1  thrpt    5  30102.572 ±  499.339  ops/ms
uuid_creator_12_time_ordered_epoch_plusn  thrpt    5   6342.547 ±  198.652  ops/ms
-----------------------------------------------------------------------------------
Total time: 00:05:20
-----------------------------------------------------------------------------------

Throughput with 4 threads

-------------------------------------------------------------------------------------
THROUGHPUT (operations/msec)               Mode  Cnt       Score       Error   Units 
-------------------------------------------------------------------------------------
jdk_uuid_01_to_string                     thrpt    5  115904.890 ± 60611.763  ops/ms (74.83)
jdk_uuid_02_from_string                   thrpt    5   28469.143 ±   423.811  ops/ms (18.38)
jdk_uuid_03_random_based                  thrpt    5    1548.968 ±   107.588  ops/ms ( 1.00)
jdk_uuid_04_name_based_md5                thrpt    5    7384.515 ±   407.114  ops/ms ( 4.77)
-------------------------------------------------------------------------------------
uuid_creator_01_to_string                 thrpt    5  117074.078 ±  3942.468  ops/ms (75.58)
uuid_creator_02_from_string               thrpt    5   52728.188 ±  2077.384  ops/ms (34.04)
uuid_creator_03_random_based              thrpt    5    2119.759 ±   110.943  ops/ms ( 1.37)
uuid_creator_04_prefix_comb               thrpt    5    2616.717 ±    14.365  ops/ms
uuid_creator_05_short_prefix_comb         thrpt    5    2037.100 ±    19.654  ops/ms
uuid_creator_06_name_based_md5            thrpt    5    7798.832 ±   724.149  ops/ms ( 5.03)
uuid_creator_07_name_based_sha1           thrpt    5    7936.844 ±   234.769  ops/ms
uuid_creator_08_time_based                thrpt    5    9985.182 ±    93.094  ops/ms
uuid_creator_09_time_ordered              thrpt    5    9987.568 ±    85.208  ops/ms
uuid_creator_10_time_ordered_epoch        thrpt    5    3091.607 ±    89.739  ops/ms
uuid_creator_11_time_ordered_epoch_plus1  thrpt    5   11768.436 ±  1828.930  ops/ms
uuid_creator_12_time_ordered_epoch_plusn  thrpt    5    3718.079 ±     8.317  ops/ms
-------------------------------------------------------------------------------------
Total time: 00:05:20
-------------------------------------------------------------------------------------

System: CPU i7-8565U, 16G RAM, Ubuntu 22.04, JVM 11, rng-tools installed.

Clone this wiki locally