fruffl icon

performance call_user_func_array(), switch($args) and unpack

fruffl | 09/29/15 09:27:19 PM UTC | 0 ⭐ | 323 👁️ | Never ⏰ | []
PHP |

4.18 KB

|

None

|

0 👍

/

0 👎

PHP 5.6.13-1~dotdeb+7.1 Linux/fpm-fcgi - Tue, 29 Sep 2015 21:26:04 UTC 
 
 
* TEST #1: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #0# args:
 
cufa   with 0 args took 0.29814720153809
switch with 0 args took 0.13980913162231
unpack with 0 args took 0.07956600189209
 
* TEST #2: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #1# args:
 
cufa   with 1 args took 0.35638022422791
switch with 1 args took 0.20504999160767
unpack with 1 args took 0.088035106658936
 
* TEST #3: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #2# args:
 
cufa   with 2 args took 0.37427711486816
switch with 2 args took 0.23678708076477
unpack with 2 args took 0.099796056747437
 
* TEST #4: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #3# args:
 
cufa   with 3 args took 0.39740991592407
switch with 3 args took 0.23624682426453
unpack with 3 args took 0.097595930099487
 
* TEST #5: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #4# args:
 
cufa   with 4 args took 0.41449594497681
switch with 4 args took 0.25830888748169
unpack with 4 args took 0.10406899452209
 
* TEST #6: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #5# args:
 
cufa   with 5 args took 0.43375301361084
switch with 5 args took 0.27447104454041
unpack with 5 args took 0.11049485206604
 
* TEST #7: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #6# args:
 
cufa   with 6 args took 0.44970917701721
switch with 6 args took 0.60039305686951
unpack with 6 args took 0.11522197723389
 
* TEST #8: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #7# args:
 
cufa   with 7 args took 0.46644616127014
switch with 7 args took 0.63432002067566
unpack with 7 args took 0.12022709846497
 
* TEST #9: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #8# args:
 
cufa   with 8 args took 0.48480701446533
switch with 8 args took 0.65742588043213
unpack with 8 args took 0.1253650188446
 
* TEST #10: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #9# args:
 
cufa   with 9 args took 0.51334190368652
switch with 9 args took 0.66609477996826
unpack with 9 args took 0.12978887557983
 
* TEST #11: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #10# args:
 
cufa   with 10 args took 0.52916502952576
switch with 10 args took 0.68552803993225
unpack with 10 args took 0.13697290420532
 
* TEST #12: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #11# args:
 
cufa   with 11 args took 0.55145812034607
switch with 11 args took 0.742506980896
unpack with 11 args took 0.14194917678833
 
* TEST #13: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #12# args:
 
cufa   with 12 args took 0.56378293037415
switch with 12 args took 0.72208094596863
unpack with 12 args took 0.14727520942688
 
* TEST #14: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #13# args:
 
cufa   with 13 args took 0.58317089080811
switch with 13 args took 0.74632716178894
unpack with 13 args took 0.15246415138245
 
* TEST #15: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #14# args:
 
cufa   with 14 args took 0.60100603103638
switch with 14 args took 0.76287794113159
unpack with 14 args took 0.15673184394836
 
* TEST #16: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #15# args:
 
cufa   with 15 args took 0.614905834198
switch with 15 args took 0.79118895530701
unpack with 15 args took 0.1613130569458

Comments