Skip to content

Latest commit

 

History

History
314 lines (280 loc) · 29.3 KB

BENCHMARK.md

File metadata and controls

314 lines (280 loc) · 29.3 KB

Leviathan Benchmarking Results

This page presents the benchmarking results for Leviathan, showcasing its performance and efficiency compared to other event loops. The tests compare the implementation of the asyncio standard event loop, uvloop, Leviathan (single thread mode) and Leviathan (thread-safe).

Test Environment

  • CPU: 12th Gen Intel(R) Core(TM) i7-1255U
  • Operating System: Linux Kernel 6.12.6-zen1-1-zen

Axis Explanation

In the benchmark charts:

  • The X-axis represents various metrics, usually the number of events or tasks processed.
  • The Y-axis represents the time taken to complete the test. Lower values indicate better performance.

Benchmark Tests

Test 1: Producer - Consumer

For more information, refer to the code repository.

+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+
|           Loop          |    M    | Avg Time (s) | Std (s)  |  Min (s)  |  Max (s)  |  Diff (s)  | Relative Speed |
+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+
|         asyncio         |   1024  |   0.375018   | 0.010022 |  0.368652 |  0.402833 |  0.000000  |      1.00      |
|         asyncio         |   2048  |   0.387695   | 0.008655 |  0.378153 |  0.409862 |  0.000000  |      1.00      |
|         asyncio         |   4096  |   0.416794   | 0.020207 |  0.398286 |  0.451082 |  0.000000  |      1.00      |
|         asyncio         |   8192  |   0.468430   | 0.017865 |  0.444387 |  0.497959 |  0.000000  |      1.00      |
|         asyncio         |  16384  |   0.595335   | 0.013538 |  0.578329 |  0.616394 |  0.000000  |      1.00      |
|         asyncio         |  32768  |   0.903641   | 0.040486 |  0.858796 |  0.957626 |  0.000000  |      1.00      |
|         asyncio         |  65536  |   1.685111   | 0.026527 |  1.654442 |  1.726105 |  0.000000  |      1.00      |
|         asyncio         |  131072 |   3.887343   | 0.037467 |  3.822594 |  3.950398 |  0.000000  |      1.00      |
|         asyncio         |  262144 |   8.129758   | 0.065539 |  8.040083 |  8.236580 |  0.000000  |      1.00      |
|         asyncio         |  524288 |  16.340546   | 0.083860 | 16.234476 | 16.535204 |  0.000000  |      1.00      |
|         asyncio         | 1048576 |  33.054609   | 0.349142 | 32.671418 | 33.736677 |  0.000000  |      1.00      |
|          uvloop         |   1024  |   0.368026   | 0.002628 |  0.364697 |  0.373023 | -0.006991  |      1.02      |
|          uvloop         |   2048  |   0.378254   | 0.003247 |  0.374410 |  0.383970 | -0.009441  |      1.02      |
|          uvloop         |   4096  |   0.390858   | 0.004942 |  0.384778 |  0.399659 | -0.025936  |      1.07      |
|          uvloop         |   8192  |   0.447996   | 0.022594 |  0.415997 |  0.484102 | -0.020434  |      1.05      |
|          uvloop         |  16384  |   0.533285   | 0.017749 |  0.512389 |  0.571963 | -0.062051  |      1.12      |
|          uvloop         |  32768  |   0.769410   | 0.036433 |  0.721310 |  0.819421 | -0.134232  |      1.17      |
|          uvloop         |  65536  |   1.375576   | 0.047785 |  1.314090 |  1.448086 | -0.309536  |      1.23      |
|          uvloop         |  131072 |   3.184596   | 0.063338 |  3.106580 |  3.312119 | -0.702747  |      1.22      |
|          uvloop         |  262144 |   6.620038   | 0.044339 |  6.532523 |  6.690536 | -1.509720  |      1.23      |
|          uvloop         |  524288 |  13.044693   | 0.102873 | 12.920414 | 13.264171 | -3.295853  |      1.25      |
|          uvloop         | 1048576 |  26.512807   | 0.338647 | 26.111257 | 27.246125 | -6.541802  |      1.25      |
|        leviathan        |   1024  |   0.364387   | 0.002164 |  0.361279 |  0.368495 | -0.010631  |      1.03      |
|        leviathan        |   2048  |   0.375450   | 0.003666 |  0.371887 |  0.380825 | -0.012245  |      1.03      |
|        leviathan        |   4096  |   0.395467   | 0.015727 |  0.386498 |  0.438793 | -0.021327  |      1.05      |
|        leviathan        |   8192  |   0.436470   | 0.027073 |  0.406405 |  0.487061 | -0.031960  |      1.07      |
|        leviathan        |  16384  |   0.504719   | 0.016756 |  0.481492 |  0.541508 | -0.090616  |      1.18      |
|        leviathan        |  32768  |   0.703282   | 0.032788 |  0.660671 |  0.774562 | -0.200359  |      1.28      |
|        leviathan        |  65536  |   1.181601   | 0.065622 |  1.094126 |  1.268211 | -0.503510  |      1.43      |
|        leviathan        |  131072 |   2.381997   | 0.070825 |  2.273449 |  2.478587 | -1.505346  |      1.63      |
|        leviathan        |  262144 |   4.994973   | 0.093709 |  4.823518 |  5.140560 | -3.134785  |      1.63      |
|        leviathan        |  524288 |  10.162340   | 0.353300 |  9.631937 | 10.658074 | -6.178206  |      1.61      |
|        leviathan        | 1048576 |  20.467259   | 0.454458 | 19.749102 | 21.438692 | -12.587351 |      1.61      |
| leviathan (Thread-safe) |   1024  |   0.366674   | 0.003537 |  0.361687 |  0.374967 | -0.008344  |      1.02      |
| leviathan (Thread-safe) |   2048  |   0.377521   | 0.004889 |  0.370672 |  0.387584 | -0.010173  |      1.03      |
| leviathan (Thread-safe) |   4096  |   0.407951   | 0.025343 |  0.392205 |  0.456074 | -0.008843  |      1.02      |
| leviathan (Thread-safe) |   8192  |   0.463298   | 0.036226 |  0.416922 |  0.526343 | -0.005132  |      1.01      |
| leviathan (Thread-safe) |  16384  |   0.544518   | 0.009624 |  0.533693 |  0.562228 | -0.050817  |      1.09      |
| leviathan (Thread-safe) |  32768  |   0.811829   | 0.034211 |  0.763737 |  0.872738 | -0.091812  |      1.11      |
| leviathan (Thread-safe) |  65536  |   1.470490   | 0.099596 |  1.292009 |  1.607354 | -0.214622  |      1.15      |
| leviathan (Thread-safe) |  131072 |   3.041560   | 0.143845 |  2.898891 |  3.301880 | -0.845783  |      1.28      |
| leviathan (Thread-safe) |  262144 |   6.264837   | 0.138828 |  6.101678 |  6.510092 | -1.864921  |      1.30      |
| leviathan (Thread-safe) |  524288 |  11.931302   | 0.383676 | 11.190677 | 12.321946 | -4.409244  |      1.37      |
| leviathan (Thread-safe) | 1048576 |  22.625772   | 0.677027 | 21.588504 | 23.693504 | -10.428838 |      1.46      |
+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+

Latency Test Results


Test 2: Task Workflow

For more information, refer to the code repository.

+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+
|           Loop          |    M    | Avg Time (s) | Std (s)  |  Min (s)  |  Max (s)  |  Diff (s)  | Relative Speed |
+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+
|         asyncio         |   1024  |   0.134028   | 0.008350 |  0.128858 |  0.148825 |  0.000000  |      1.00      |
|         asyncio         |   2048  |   0.169741   | 0.020710 |  0.155876 |  0.206157 |  0.000000  |      1.00      |
|         asyncio         |   4096  |   0.250220   | 0.015975 |  0.223897 |  0.264706 |  0.000000  |      1.00      |
|         asyncio         |   8192  |   0.452560   | 0.048827 |  0.365851 |  0.481424 |  0.000000  |      1.00      |
|         asyncio         |  16384  |   0.915671   | 0.073769 |  0.828569 |  1.014413 |  0.000000  |      1.00      |
|         asyncio         |  32768  |   2.064106   | 0.117888 |  1.987659 |  2.270346 |  0.000000  |      1.00      |
|         asyncio         |  65536  |   4.757083   | 0.031608 |  4.720270 |  4.804005 |  0.000000  |      1.00      |
|         asyncio         |  131072 |  10.315472   | 0.313513 |  9.911904 | 10.712905 |  0.000000  |      1.00      |
|         asyncio         |  262144 |  20.684352   | 0.380911 | 20.124141 | 21.192912 |  0.000000  |      1.00      |
|         asyncio         |  524288 |  41.492322   | 0.510154 | 40.735358 | 42.073255 |  0.000000  |      1.00      |
|         asyncio         | 1048576 |  82.861795   | 2.185065 | 80.447485 | 84.600065 |  0.000000  |      1.00      |
|          uvloop         |   1024  |   0.121851   | 0.002563 |  0.118154 |  0.124644 | -0.012177  |      1.10      |
|          uvloop         |   2048  |   0.138642   | 0.001049 |  0.137228 |  0.139989 | -0.031100  |      1.22      |
|          uvloop         |   4096  |   0.178471   | 0.001910 |  0.175765 |  0.180271 | -0.071749  |      1.40      |
|          uvloop         |   8192  |   0.261669   | 0.004655 |  0.254622 |  0.265866 | -0.190890  |      1.73      |
|          uvloop         |  16384  |   0.715202   | 0.168447 |  0.468395 |  0.911077 | -0.200469  |      1.28      |
|          uvloop         |  32768  |   1.815815   | 0.209367 |  1.577443 |  2.016179 | -0.248292  |      1.14      |
|          uvloop         |  65536  |   4.187641   | 0.136092 |  4.038903 |  4.401987 | -0.569442  |      1.14      |
|          uvloop         |  131072 |   8.862893   | 0.148427 |  8.708782 |  9.107963 | -1.452579  |      1.16      |
|          uvloop         |  262144 |  17.280605   | 0.202800 | 17.059753 | 17.497679 | -3.403747  |      1.20      |
|          uvloop         |  524288 |  33.709605   | 0.630104 | 33.027200 | 34.702825 | -7.782716  |      1.23      |
|          uvloop         | 1048576 |  68.277847   | 2.535003 | 64.588962 | 70.699248 | -14.583948 |      1.21      |
|        leviathan        |   1024  |   0.120266   | 0.002815 |  0.118332 |  0.125163 | -0.013762  |      1.11      |
|        leviathan        |   2048  |   0.132001   | 0.001365 |  0.130803 |  0.134131 | -0.037740  |      1.29      |
|        leviathan        |   4096  |   0.164734   | 0.002809 |  0.161295 |  0.168951 | -0.085487  |      1.52      |
|        leviathan        |   8192  |   0.229044   | 0.005149 |  0.222045 |  0.234868 | -0.223516  |      1.98      |
|        leviathan        |  16384  |   0.397866   | 0.012695 |  0.376322 |  0.407332 | -0.517804  |      2.30      |
|        leviathan        |  32768  |   1.210797   | 0.077759 |  1.089048 |  1.293357 | -0.853310  |      1.70      |
|        leviathan        |  65536  |   2.974424   | 0.163094 |  2.748406 |  3.200891 | -1.782660  |      1.60      |
|        leviathan        |  131072 |   5.980199   | 0.152210 |  5.780707 |  6.172673 | -4.335273  |      1.72      |
|        leviathan        |  262144 |  11.683447   | 0.328172 | 11.183694 | 12.039191 | -9.000905  |      1.77      |
|        leviathan        |  524288 |  22.863529   | 0.566871 | 22.254479 | 23.723134 | -18.628792 |      1.81      |
|        leviathan        | 1048576 |  46.243996   | 3.523557 | 43.564038 | 52.322705 | -36.617799 |      1.79      |
| leviathan (Thread-safe) |   1024  |   0.125138   | 0.003600 |  0.120995 |  0.128530 | -0.008890  |      1.07      |
| leviathan (Thread-safe) |   2048  |   0.139609   | 0.005408 |  0.135828 |  0.148671 | -0.030133  |      1.22      |
| leviathan (Thread-safe) |   4096  |   0.178747   | 0.004965 |  0.171289 |  0.185004 | -0.071474  |      1.40      |
| leviathan (Thread-safe) |   8192  |   0.463265   | 0.444798 |  0.257737 |  1.258885 |  0.010706  |      0.98      |
| leviathan (Thread-safe) |  16384  |   0.901455   | 0.566683 |  0.477525 |  1.523778 | -0.014215  |      1.02      |
| leviathan (Thread-safe) |  32768  |   1.536727   | 0.558720 |  0.920464 |  1.985868 | -0.527379  |      1.34      |
| leviathan (Thread-safe) |  65536  |   3.240519   | 0.559413 |  2.804129 |  3.866802 | -1.516565  |      1.47      |
| leviathan (Thread-safe) |  131072 |   6.345228   | 0.676297 |  5.831912 |  7.158005 | -3.970244  |      1.63      |
| leviathan (Thread-safe) |  262144 |  11.789295   | 1.083983 | 10.795235 | 13.447184 | -8.895057  |      1.75      |
| leviathan (Thread-safe) |  524288 |  23.937342   | 1.189446 | 22.737851 | 25.599161 | -17.554980 |      1.73      |
| leviathan (Thread-safe) | 1048576 |  69.699637   | 8.955139 | 60.438495 | 79.583442 | -13.162157 |      1.19      |
+-------------------------+---------+--------------+----------+-----------+-----------+------------+----------------+

Throughput Test Results


Test 3: Event Fiesta Factory

For more information, refer to the code repository.

+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+
|           Loop          |    M    | Avg Time (s) | Std (s)  |  Min (s)  |  Max (s)  |  Diff (s) | Relative Speed |
+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+
|         asyncio         |   1024  |   0.008297   | 0.001008 |  0.007641 |  0.010069 |  0.000000 |      1.00      |
|         asyncio         |   2048  |   0.021029   | 0.009324 |  0.015979 |  0.037671 |  0.000000 |      1.00      |
|         asyncio         |   4096  |   0.038187   | 0.007089 |  0.034327 |  0.050731 |  0.000000 |      1.00      |
|         asyncio         |   8192  |   0.094869   | 0.022934 |  0.070970 |  0.123808 |  0.000000 |      1.00      |
|         asyncio         |  16384  |   0.195122   | 0.016901 |  0.174545 |  0.220684 |  0.000000 |      1.00      |
|         asyncio         |  32768  |   0.437433   | 0.031800 |  0.411314 |  0.491868 |  0.000000 |      1.00      |
|         asyncio         |  65536  |   1.110414   | 0.042283 |  1.071026 |  1.171607 |  0.000000 |      1.00      |
|         asyncio         |  131072 |   2.824722   | 0.177047 |  2.610265 |  3.076836 |  0.000000 |      1.00      |
|         asyncio         |  262144 |   6.039110   | 0.392077 |  5.390736 |  6.368171 |  0.000000 |      1.00      |
|         asyncio         |  524288 |  12.333188   | 1.187953 | 10.801023 | 13.549495 |  0.000000 |      1.00      |
|         asyncio         | 1048576 |  24.472050   | 2.953708 | 21.301061 | 28.648242 |  0.000000 |      1.00      |
|          uvloop         |   1024  |   0.006551   | 0.001284 |  0.005583 |  0.008802 | -0.001746 |      1.27      |
|          uvloop         |   2048  |   0.012608   | 0.000580 |  0.011965 |  0.013246 | -0.008421 |      1.67      |
|          uvloop         |   4096  |   0.029603   | 0.003558 |  0.026929 |  0.035650 | -0.008585 |      1.29      |
|          uvloop         |   8192  |   0.061475   | 0.002606 |  0.059049 |  0.065885 | -0.033394 |      1.54      |
|          uvloop         |  16384  |   0.409935   | 0.257272 |  0.124939 |  0.625488 |  0.214813 |      0.48      |
|          uvloop         |  32768  |   1.136806   | 0.219967 |  0.746243 |  1.254680 |  0.699373 |      0.38      |
|          uvloop         |  65536  |   2.130005   | 0.353644 |  1.614962 |  2.606240 |  1.019592 |      0.52      |
|          uvloop         |  131072 |   4.049438   | 0.426913 |  3.580983 |  4.611872 |  1.224715 |      0.70      |
|          uvloop         |  262144 |   7.189757   | 0.721214 |  6.324345 |  8.165337 |  1.150647 |      0.84      |
|          uvloop         |  524288 |  13.751173   | 0.813986 | 12.508862 | 14.459211 |  1.417985 |      0.90      |
|          uvloop         | 1048576 |  22.664332   | 1.931204 | 19.489851 | 24.364738 | -1.807718 |      1.08      |
|        leviathan        |   1024  |   0.005820   | 0.001148 |  0.004749 |  0.007521 | -0.002477 |      1.43      |
|        leviathan        |   2048  |   0.011078   | 0.000505 |  0.010482 |  0.011783 | -0.009951 |      1.90      |
|        leviathan        |   4096  |   0.023054   | 0.000729 |  0.022156 |  0.024093 | -0.015134 |      1.66      |
|        leviathan        |   8192  |   0.050353   | 0.000981 |  0.049286 |  0.051474 | -0.044516 |      1.88      |
|        leviathan        |  16384  |   0.106596   | 0.003870 |  0.103443 |  0.113130 | -0.088526 |      1.83      |
|        leviathan        |  32768  |   0.524590   | 0.284289 |  0.213735 |  0.771195 |  0.087157 |      0.83      |
|        leviathan        |  65536  |   1.831908   | 0.273557 |  1.509865 |  2.078826 |  0.721494 |      0.61      |
|        leviathan        |  131072 |   3.188058   | 0.455266 |  2.696271 |  3.763029 |  0.363336 |      0.89      |
|        leviathan        |  262144 |   5.976918   | 0.678357 |  4.982496 |  6.813848 | -0.062192 |      1.01      |
|        leviathan        |  524288 |  11.217216   | 0.836350 | 10.146951 | 12.329180 | -1.115972 |      1.10      |
|        leviathan        | 1048576 |  19.698284   | 2.052252 | 17.767812 | 22.212158 | -4.773766 |      1.24      |
| leviathan (Thread-safe) |   1024  |   0.005776   | 0.001114 |  0.004982 |  0.007714 | -0.002521 |      1.44      |
| leviathan (Thread-safe) |   2048  |   0.011909   | 0.001001 |  0.010918 |  0.013314 | -0.009120 |      1.77      |
| leviathan (Thread-safe) |   4096  |   0.025627   | 0.001042 |  0.024195 |  0.026727 | -0.012561 |      1.49      |
| leviathan (Thread-safe) |   8192  |   0.064032   | 0.003679 |  0.057647 |  0.066738 | -0.030837 |      1.48      |
| leviathan (Thread-safe) |  16384  |   0.115657   | 0.005990 |  0.111217 |  0.122665 | -0.079465 |      1.69      |
| leviathan (Thread-safe) |  32768  |   0.552796   | 0.479433 |  0.225447 |  1.307083 |  0.115363 |      0.79      |
| leviathan (Thread-safe) |  65536  |   1.904080   | 0.284859 |  1.564352 |  2.164516 |  0.793667 |      0.58      |
| leviathan (Thread-safe) |  131072 |   3.485383   | 0.396583 |  2.866895 |  3.972738 |  0.660661 |      0.81      |
| leviathan (Thread-safe) |  262144 |   6.301983   | 0.711853 |  5.723702 |  7.156386 |  0.262873 |      0.96      |
| leviathan (Thread-safe) |  524288 |  11.755830   | 1.322109 | 10.019304 | 13.463421 | -0.577358 |      1.05      |
| leviathan (Thread-safe) | 1048576 |  20.584829   | 1.792399 | 18.344899 | 23.189333 | -3.887221 |      1.19      |
+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+

Memory Usage Test Results


Test 4: Chat

For more information, refer to the code repository.

+-------------------------+---------+--------------+----------+------------+------------+-------------+----------------+
|           Loop          |    M    | Avg Time (s) | Std (s)  |  Min (s)   |  Max (s)   |   Diff (s)  | Relative Speed |
+-------------------------+---------+--------------+----------+------------+------------+-------------+----------------+
|         asyncio         |   1024  |   1.282383   | 0.009293 |  1.270238  |  1.291187  |   0.000000  |      1.00      |
|         asyncio         |   2048  |   1.304388   | 0.015077 |  1.281692  |  1.322457  |   0.000000  |      1.00      |
|         asyncio         |   4096  |   1.317350   | 0.007364 |  1.306864  |  1.324807  |   0.000000  |      1.00      |
|         asyncio         |   8192  |   1.500066   | 0.259278 |  1.370869  |  1.963298  |   0.000000  |      1.00      |
|         asyncio         |  16384  |   2.736583   | 0.287174 |  2.409391  |  2.998079  |   0.000000  |      1.00      |
|         asyncio         |  32768  |   5.446193   | 0.303722 |  5.157299  |  5.927114  |   0.000000  |      1.00      |
|         asyncio         |  65536  |  11.763448   | 0.202390 | 11.654359  | 12.121911  |   0.000000  |      1.00      |
|         asyncio         |  131072 |  25.392508   | 0.444236 | 25.123286  | 26.177662  |   0.000000  |      1.00      |
|         asyncio         |  262144 |  50.735398   | 0.779790 | 49.870661  | 51.779669  |   0.000000  |      1.00      |
|         asyncio         |  524288 |  101.804797  | 1.105424 | 100.154110 | 103.123745 |   0.000000  |      1.00      |
|         asyncio         | 1048576 |  190.349072  | 1.705203 | 188.422919 | 192.132488 |   0.000000  |      1.00      |
|          uvloop         |   1024  |   1.273323   | 0.008527 |  1.263567  |  1.286516  |  -0.009060  |      1.01      |
|          uvloop         |   2048  |   1.292498   | 0.005975 |  1.282831  |  1.297048  |  -0.011890  |      1.01      |
|          uvloop         |   4096  |   1.298408   | 0.006065 |  1.290732  |  1.305087  |  -0.018942  |      1.01      |
|          uvloop         |   8192  |   1.729940   | 0.204466 |  1.365915  |  1.844768  |   0.229874  |      0.87      |
|          uvloop         |  16384  |   2.530354   | 0.228040 |  2.130977  |  2.697850  |  -0.206229  |      1.08      |
|          uvloop         |  32768  |   5.145567   | 0.283020 |  4.885735  |  5.471380  |  -0.300626  |      1.06      |
|          uvloop         |  65536  |  10.711123   | 0.219222 | 10.463346  | 10.945348  |  -1.052325  |      1.10      |
|          uvloop         |  131072 |  22.281642   | 1.080690 | 21.191074  | 23.947658  |  -3.110867  |      1.14      |
|          uvloop         |  262144 |  42.718136   | 0.769469 | 41.745776  | 43.516010  |  -8.017262  |      1.19      |
|          uvloop         |  524288 |  82.312724   | 0.892185 | 80.792410  | 82.973889  |  -19.492072 |      1.24      |
|          uvloop         | 1048576 |  152.743055  | 2.951575 | 148.077070 | 155.581147 |  -37.606018 |      1.25      |
|        leviathan        |   1024  |   1.267021   | 0.005490 |  1.261616  |  1.275056  |  -0.015362  |      1.01      |
|        leviathan        |   2048  |   1.284644   | 0.007168 |  1.278529  |  1.293844  |  -0.019745  |      1.02      |
|        leviathan        |   4096  |   1.299828   | 0.007796 |  1.294216  |  1.313470  |  -0.017522  |      1.01      |
|        leviathan        |   8192  |   1.425916   | 0.203537 |  1.322250  |  1.789482  |  -0.074150  |      1.05      |
|        leviathan        |  16384  |   1.933249   | 0.009983 |  1.920650  |  1.948610  |  -0.803334  |      1.42      |
|        leviathan        |  32768  |   3.185128   | 0.028512 |  3.153716  |  3.228363  |  -2.261065  |      1.71      |
|        leviathan        |  65536  |   6.052612   | 0.238427 |  5.633223  |  6.220020  |  -5.710836  |      1.94      |
|        leviathan        |  131072 |  12.031673   | 0.116238 | 11.833281  | 12.113225  |  -13.360835 |      2.11      |
|        leviathan        |  262144 |  23.908303   | 0.354847 | 23.643685  | 24.523418  |  -26.827095 |      2.12      |
|        leviathan        |  524288 |  45.613273   | 0.628571 | 44.609994  | 46.248164  |  -56.191523 |      2.23      |
|        leviathan        | 1048576 |  85.410455   | 0.797819 | 84.219854  | 86.156391  | -104.938617 |      2.23      |
| leviathan (Thread-safe) |   1024  |   1.262927   | 0.005113 |  1.257240  |  1.270050  |  -0.019456  |      1.02      |
| leviathan (Thread-safe) |   2048  |   1.284139   | 0.010881 |  1.274806  |  1.301416  |  -0.020249  |      1.02      |
| leviathan (Thread-safe) |   4096  |   1.301013   | 0.007153 |  1.294842  |  1.312544  |  -0.016338  |      1.01      |
| leviathan (Thread-safe) |   8192  |   1.533695   | 0.261098 |  1.333453  |  1.826828  |   0.033628  |      0.98      |
| leviathan (Thread-safe) |  16384  |   1.939580   | 0.010985 |  1.929760  |  1.958194  |  -0.797003  |      1.41      |
| leviathan (Thread-safe) |  32768  |   3.191651   | 0.043971 |  3.139320  |  3.255613  |  -2.254542  |      1.71      |
| leviathan (Thread-safe) |  65536  |   6.129553   | 0.236711 |  5.712924  |  6.299332  |  -5.633895  |      1.92      |
| leviathan (Thread-safe) |  131072 |  12.202613   | 0.054105 | 12.136703  | 12.276194  |  -13.189896 |      2.08      |
| leviathan (Thread-safe) |  262144 |  24.238606   | 0.371973 | 23.893528  | 24.863546  |  -26.496792 |      2.09      |
| leviathan (Thread-safe) |  524288 |  46.149951   | 1.686452 | 44.867801  | 49.031149  |  -55.654846 |      2.21      |
| leviathan (Thread-safe) | 1048576 |  86.425608   | 1.455244 | 84.252783  | 88.006353  | -103.923464 |      2.20      |
+-------------------------+---------+--------------+----------+------------+------------+-------------+----------------+

Network I/O Test Results


Test 5: Food Delivery

For more information, refer to the code repository.

+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+
|           Loop          |    M    | Avg Time (s) | Std (s)  |  Min (s)  |  Max (s)  |  Diff (s) | Relative Speed |
+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+
|         asyncio         |   1024  |   0.213942   | 0.003711 |  0.209865 |  0.218530 |  0.000000 |      1.00      |
|         asyncio         |   2048  |   0.205987   | 0.050005 |  0.118253 |  0.244148 |  0.000000 |      1.00      |
|         asyncio         |   4096  |   0.233860   | 0.005403 |  0.229497 |  0.242472 |  0.000000 |      1.00      |
|         asyncio         |   8192  |   0.265175   | 0.017228 |  0.247747 |  0.285947 |  0.000000 |      1.00      |
|         asyncio         |  16384  |   0.320709   | 0.016963 |  0.294617 |  0.337122 |  0.000000 |      1.00      |
|         asyncio         |  32768  |   0.432045   | 0.017832 |  0.418623 |  0.455751 |  0.000000 |      1.00      |
|         asyncio         |  65536  |   0.773801   | 0.060776 |  0.670893 |  0.831887 |  0.000000 |      1.00      |
|         asyncio         |  131072 |   1.816105   | 0.113488 |  1.721338 |  2.013246 |  0.000000 |      1.00      |
|         asyncio         |  262144 |   4.067129   | 0.206805 |  3.836306 |  4.333449 |  0.000000 |      1.00      |
|         asyncio         |  524288 |   8.406694   | 0.524859 |  7.806471 |  9.078897 |  0.000000 |      1.00      |
|         asyncio         | 1048576 |  16.934769   | 1.054783 | 15.425269 | 18.216329 |  0.000000 |      1.00      |
|          uvloop         |   1024  |   0.211735   | 0.001580 |  0.209147 |  0.213445 | -0.002208 |      1.01      |
|          uvloop         |   2048  |   0.198102   | 0.045019 |  0.117843 |  0.223406 | -0.007885 |      1.04      |
|          uvloop         |   4096  |   0.232494   | 0.004741 |  0.227102 |  0.238307 | -0.001367 |      1.01      |
|          uvloop         |   8192  |   0.225809   | 0.042195 |  0.150951 |  0.252203 | -0.039365 |      1.17      |
|          uvloop         |  16384  |   0.291878   | 0.018578 |  0.274506 |  0.315345 | -0.028831 |      1.10      |
|          uvloop         |  32768  |   0.399522   | 0.025834 |  0.374251 |  0.439365 | -0.032522 |      1.08      |
|          uvloop         |  65536  |   0.675341   | 0.023375 |  0.655817 |  0.713201 | -0.098460 |      1.15      |
|          uvloop         |  131072 |   1.496600   | 0.118094 |  1.392732 |  1.692626 | -0.319505 |      1.21      |
|          uvloop         |  262144 |   3.609815   | 0.305399 |  3.305795 |  4.081783 | -0.457315 |      1.13      |
|          uvloop         |  524288 |   6.892482   | 0.317169 |  6.466704 |  7.194207 | -1.514212 |      1.22      |
|          uvloop         | 1048576 |  14.903574   | 0.523739 | 14.173310 | 15.514117 | -2.031195 |      1.14      |
|        leviathan        |   1024  |   0.210283   | 0.002471 |  0.206983 |  0.213053 | -0.003659 |      1.02      |
|        leviathan        |   2048  |   0.219308   | 0.001608 |  0.217906 |  0.221904 |  0.013320 |      0.94      |
|        leviathan        |   4096  |   0.227789   | 0.004976 |  0.221467 |  0.233359 | -0.006072 |      1.03      |
|        leviathan        |   8192  |   0.243157   | 0.004826 |  0.235280 |  0.247186 | -0.022017 |      1.09      |
|        leviathan        |  16384  |   0.271161   | 0.004363 |  0.266423 |  0.276817 | -0.049548 |      1.18      |
|        leviathan        |  32768  |   0.355931   | 0.073200 |  0.228758 |  0.414696 | -0.076114 |      1.21      |
|        leviathan        |  65536  |   0.608057   | 0.038940 |  0.568403 |  0.666166 | -0.165745 |      1.27      |
|        leviathan        |  131072 |   1.283850   | 0.115180 |  1.192737 |  1.482356 | -0.532255 |      1.41      |
|        leviathan        |  262144 |   2.722591   | 0.121669 |  2.590392 |  2.899703 | -1.344538 |      1.49      |
|        leviathan        |  524288 |   6.050718   | 0.573716 |  5.439655 |  6.889091 | -2.355976 |      1.39      |
|        leviathan        | 1048576 |  11.804799   | 0.644189 | 10.733829 | 12.356239 | -5.129971 |      1.43      |
| leviathan (Thread-safe) |   1024  |   0.211711   | 0.001166 |  0.210057 |  0.213210 | -0.002231 |      1.01      |
| leviathan (Thread-safe) |   2048  |   0.218711   | 0.001230 |  0.216674 |  0.219951 |  0.012724 |      0.94      |
| leviathan (Thread-safe) |   4096  |   0.256952   | 0.066262 |  0.226189 |  0.375474 |  0.023092 |      0.91      |
| leviathan (Thread-safe) |   8192  |   0.262622   | 0.049895 |  0.234822 |  0.351615 | -0.002553 |      1.01      |
| leviathan (Thread-safe) |  16384  |   0.344388   | 0.062810 |  0.269750 |  0.396720 |  0.023678 |      0.93      |
| leviathan (Thread-safe) |  32768  |   0.466832   | 0.019537 |  0.447335 |  0.492419 |  0.034787 |      0.93      |
| leviathan (Thread-safe) |  65536  |   0.845629   | 0.100797 |  0.759931 |  0.971075 |  0.071827 |      0.92      |
| leviathan (Thread-safe) |  131072 |   1.609617   | 0.138211 |  1.443702 |  1.812005 | -0.206488 |      1.13      |
| leviathan (Thread-safe) |  262144 |   3.237495   | 0.111707 |  3.098228 |  3.381273 | -0.829634 |      1.26      |
| leviathan (Thread-safe) |  524288 |   6.584585   | 0.680144 |  5.652374 |  7.532337 | -1.822110 |      1.28      |
| leviathan (Thread-safe) | 1048576 |  12.995361   | 2.781370 | 10.929701 | 17.819347 | -3.939408 |      1.30      |
+-------------------------+---------+--------------+----------+-----------+-----------+-----------+----------------+

Mixed Workload Test Results