Advertisement
fruffl

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

Sep 29th, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.18 KB | None | 0 0
  1. PHP 5.6.13-1~dotdeb+7.1 Linux/fpm-fcgi - Tue, 29 Sep 2015 21:26:04 UTC
  2.  
  3.  
  4. * TEST #1: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #0# args:
  5.  
  6. cufa   with 0 args took 0.29814720153809
  7. switch with 0 args took 0.13980913162231
  8. unpack with 0 args took 0.07956600189209
  9.  
  10. * TEST #2: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #1# args:
  11.  
  12. cufa   with 1 args took 0.35638022422791
  13. switch with 1 args took 0.20504999160767
  14. unpack with 1 args took 0.088035106658936
  15.  
  16. * TEST #3: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #2# args:
  17.  
  18. cufa   with 2 args took 0.37427711486816
  19. switch with 2 args took 0.23678708076477
  20. unpack with 2 args took 0.099796056747437
  21.  
  22. * TEST #4: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #3# args:
  23.  
  24. cufa   with 3 args took 0.39740991592407
  25. switch with 3 args took 0.23624682426453
  26. unpack with 3 args took 0.097595930099487
  27.  
  28. * TEST #5: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #4# args:
  29.  
  30. cufa   with 4 args took 0.41449594497681
  31. switch with 4 args took 0.25830888748169
  32. unpack with 4 args took 0.10406899452209
  33.  
  34. * TEST #6: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #5# args:
  35.  
  36. cufa   with 5 args took 0.43375301361084
  37. switch with 5 args took 0.27447104454041
  38. unpack with 5 args took 0.11049485206604
  39.  
  40. * TEST #7: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #6# args:
  41.  
  42. cufa   with 6 args took 0.44970917701721
  43. switch with 6 args took 0.60039305686951
  44. unpack with 6 args took 0.11522197723389
  45.  
  46. * TEST #8: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #7# args:
  47.  
  48. cufa   with 7 args took 0.46644616127014
  49. switch with 7 args took 0.63432002067566
  50. unpack with 7 args took 0.12022709846497
  51.  
  52. * TEST #9: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #8# args:
  53.  
  54. cufa   with 8 args took 0.48480701446533
  55. switch with 8 args took 0.65742588043213
  56. unpack with 8 args took 0.1253650188446
  57.  
  58. * TEST #10: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #9# args:
  59.  
  60. cufa   with 9 args took 0.51334190368652
  61. switch with 9 args took 0.66609477996826
  62. unpack with 9 args took 0.12978887557983
  63.  
  64. * TEST #11: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #10# args:
  65.  
  66. cufa   with 10 args took 0.52916502952576
  67. switch with 10 args took 0.68552803993225
  68. unpack with 10 args took 0.13697290420532
  69.  
  70. * TEST #12: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #11# args:
  71.  
  72. cufa   with 11 args took 0.55145812034607
  73. switch with 11 args took 0.742506980896
  74. unpack with 11 args took 0.14194917678833
  75.  
  76. * TEST #13: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #12# args:
  77.  
  78. cufa   with 12 args took 0.56378293037415
  79. switch with 12 args took 0.72208094596863
  80. unpack with 12 args took 0.14727520942688
  81.  
  82. * TEST #14: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #13# args:
  83.  
  84. cufa   with 13 args took 0.58317089080811
  85. switch with 13 args took 0.74632716178894
  86. unpack with 13 args took 0.15246415138245
  87.  
  88. * TEST #15: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #14# args:
  89.  
  90. cufa   with 14 args took 0.60100603103638
  91. switch with 14 args took 0.76287794113159
  92. unpack with 14 args took 0.15673184394836
  93.  
  94. * TEST #16: 100000 calls: Comparison of results call_user_func_array(), switch($args) and unpack ($func(...$args)) with  #15# args:
  95.  
  96. cufa   with 15 args took 0.614905834198
  97. switch with 15 args took 0.79118895530701
  98. unpack with 15 args took 0.1613130569458
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement