Skip to content

Latest commit

 

History

History
98 lines (82 loc) · 6.24 KB

bm-20180423.md

File metadata and controls

98 lines (82 loc) · 6.24 KB

benchmark - 20180423

Collect Routes Time(ms):

  • nikic/fast-route: 77.590 ms
  • nikic/fast-route(cached): 4.182 ms
  • inhere/sroute(SRouter): 36.910 ms
  • inhere/sroute(ORouter): 31.883 ms
  • symfony/routing: 19.937 ms
  • symfony/routing(cached): 18.208 ms
  • corneltek/pux(php): 97.890 ms
  • altorouter/altorouter: 5.737 ms
  • phroute/phroute: 99.135 ms
  • noahbuscher/macaw: 10.826 ms
  • noodlehaus/dispatch: 12.121 ms
  • bephp/router: 61.230 ms
  • conformity/router: 20.957 ms
  • conformity/router(Learnable): 28.237 ms
  • baryshev/tree-route: 36.367 ms
  • mindplay/timber: 66.727 ms

First route matching

php run-first-tests.php

This benchmark tests how quickly each router can match the first route. 1,000 routes each with 9 arguments.

This benchmark consists of 16 tests. Each test is executed 1,000 times, the results pruned, and then averaged. Values that fall outside of 3 standard deviations of the mean are discarded.

Test Name Results Time(ms) + Interval Change
corneltek/pux(php) - first route(1000) 982 0.006990 +0.000000 baseline
conformity/router(Learnable) - first route (1000) 999 0.009311 +0.002321 33% slower
nikic/fast-route - first route(1000) 996 0.010034 +0.003045 44% slower
symfony/routing(cached) - first route(1000) 980 0.011734 +0.004744 68% slower
baryshev/tree-route - first route(1000 routes) 983 0.014731 +0.007741 111% slower
phroute/phroute - first route (1000 routes) 997 0.021398 +0.014408 206% slower
inhere/sroute(ORouter) - first(1000) 970 0.023796 +0.016806 240% slower
inhere/sroute(SRouter) - first(1000) 998 0.027590 +0.020600 295% slower
noodlehaus/dispatch - first route (1000 routes) 979 0.031287 +0.024297 348% slower
symfony/routing - first route(1000) 987 0.038296 +0.031306 448% slower
AltoRouter - first route (1000 routes) 969 0.043966 +0.036977 529% slower
mindplay/timber - first route(1000 routes) 997 0.044130 +0.037141 531% slower
bephp/router - first route(1000 routes) 965 0.044707 +0.037717 540% slower
nikic/fast-route(cached) - first route(1000) 999 0.101859 +0.094869 1357% slower
conformity/router - first route (1000 routes) 982 0.138267 +0.131278 1878% slower
Macaw - first route (1000 routes) 999 2.968255 +2.961266 42365% slower

Worst-case matching

$ php run-worst-tests.php

This benchmark matches the last route and unknown route. It generates a randomly prefixed and suffixed route in an attempt to thwart any optimization. 1,000 routes each with 9 arguments.

This benchmark consists of 32 tests. Each test is executed 1,000 times, the results pruned, and then averaged. Values that fall outside of 3 standard deviations of the mean are discarded.

Test Name Results Time(ms) + Interval Change
bephp/router - unknown route (1000) 949 0.008447 +0.000000 baseline
baryshev/tree-route - unknown route (1000 routes) 988 0.009216 +0.000769 9% slower
conformity/router(Learnable) - last route (1000) 999 0.009482 +0.001035 12% slower
inhere/sroute(ORouter) - unknown route (1000 routes) 996 0.009855 +0.001408 17% slower
mindplay/timber - unknown route (1000 routes) 993 0.010432 +0.001985 23% slower
inhere/sroute(SRouter) - unknown route (1000 routes) 955 0.011947 +0.003500 41% slower
baryshev/tree-route - last route (1000 routes) 969 0.015508 +0.007061 84% slower
symfony/routing(cached) - last route (1000 routes) 990 0.019688 +0.011241 133% slower
inhere/sroute(ORouter) - last route (1000 routes) 964 0.024522 +0.016076 190% slower
inhere/sroute(SRouter) - last route (1000 routes) 979 0.027112 +0.018665 221% slower
conformity/router - unknown route (1000 routes) 998 0.038058 +0.029612 351% slower
symfony/routing(cached) - unknown route (1000 routes) 970 0.040530 +0.032083 380% slower
bephp/router - last route (1000) 969 0.044418 +0.035972 426% slower
mindplay/timber - last route (1000 routes) 992 0.046320 +0.037874 448% slower
conformity/router(Learnable) - unknown route (1000) 981 0.046517 +0.038071 451% slower
FastRoute(cached) - unknown route (1000 routes) 973 0.098672 +0.090226 1068% slower
FastRoute - unknown route (1000 routes) 973 0.099844 +0.091397 1082% slower
FastRoute(cached) - last route (1000 routes) 999 0.101774 +0.093327 1105% slower
FastRoute - last route (1000 routes) 999 0.125844 +0.117397 1390% slower
phroute/phroute - unknown route (1000 routes) 996 0.129982 +0.121535 1439% slower
phroute/phroute - last route (1000 routes) 999 0.136505 +0.128059 1516% slower
Pux PHP - unknown route (1000 routes) 982 0.961330 +0.952883 11281% slower
Pux PHP - last route (1000 routes) 999 1.021619 +1.013173 11995% slower
AltoRouter - unknown route (1000 routes) 975 2.591807 +2.583360 30584% slower
AltoRouter - last route (1000 routes) 976 2.644340 +2.635894 31206% slower
Macaw - unknown route (1000 routes) 973 2.878289 +2.869842 33976% slower
symfony/routing - unknown route (1000 routes) 974 2.932998 +2.924552 34624% slower
Macaw - last route (1000 routes) 999 2.968011 +2.959564 35038% slower
symfony/routing - last route (1000 routes) 999 2.987899 +2.979452 35274% slower
noodlehaus/dispatch - unknown route (1000 routes) 978 5.302133 +5.293686 62672% slower
noodlehaus/dispatch - last route (1000 routes) 999 5.386537 +5.378091 63671% slower
conformity/router - last route (1000 routes) 987 7.363603 +7.355156 87078% slower