Guest User

https://stackoverflow.com/q/45368080/4265352

a guest
Jul 28th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.59 KB | None | 0 0
  1. ======== php bench.php 5000 20000 =============
  2. Generating 5000 elements... Done. Time: 0.001314 seconds.
  3. array_filter(): 2.90 seconds/20000 iterations. 0.000145 seconds/iteration.
  4. foreach : 4.32 seconds/20000 iterations. 0.000216 seconds/iteration.
  5. reduce @deceze: 6.97 seconds/20000 iterations. 0.000349 seconds/iteration.
  6. reduce @axiac : 9.12 seconds/20000 iterations. 0.000456 seconds/iteration.
  7.  
  8. ======== php bench.php 6000 16666 =============
  9. Generating 6000 elements... Done. Time: 0.001570 seconds.
  10. array_filter(): 3.45 seconds/16666 iterations. 0.000207 seconds/iteration.
  11. foreach : 4.55 seconds/16666 iterations. 0.000273 seconds/iteration.
  12. reduce @deceze: 7.57 seconds/16666 iterations. 0.000454 seconds/iteration.
  13. reduce @axiac : 8.37 seconds/16666 iterations. 0.000502 seconds/iteration.
  14.  
  15. ======== php bench.php 7000 14285 =============
  16. Generating 7000 elements... Done. Time: 0.001792 seconds.
  17. array_filter(): 2.87 seconds/14285 iterations. 0.000201 seconds/iteration.
  18. foreach : 4.24 seconds/14285 iterations. 0.000297 seconds/iteration.
  19. reduce @deceze: 6.92 seconds/14285 iterations. 0.000484 seconds/iteration.
  20. reduce @axiac : 8.33 seconds/14285 iterations. 0.000583 seconds/iteration.
  21.  
  22. ======== php bench.php 8000 12500 =============
  23. Generating 8000 elements... Done. Time: 0.001979 seconds.
  24. array_filter(): 173.75 seconds/12500 iterations. 0.013900 seconds/iteration.
  25. foreach : 4.29 seconds/12500 iterations. 0.000343 seconds/iteration.
  26. reduce @deceze: 7.12 seconds/12500 iterations. 0.000570 seconds/iteration.
  27. reduce @axiac : 8.65 seconds/12500 iterations. 0.000692 seconds/iteration.
  28.  
  29. ======== php bench.php 9000 11111 =============
  30. Generating 9000 elements... Done. Time: 0.032887 seconds.
  31. array_filter(): 2.97 seconds/11111 iterations. 0.000267 seconds/iteration.
  32. foreach : 4.20 seconds/11111 iterations. 0.000378 seconds/iteration.
  33. reduce @deceze: 7.35 seconds/11111 iterations. 0.000661 seconds/iteration.
  34. reduce @axiac : 8.62 seconds/11111 iterations. 0.000776 seconds/iteration.
  35.  
  36. ======== php bench.php 10000 10000 =============
  37. Generating 10000 elements... Done. Time: 0.024675 seconds.
  38. array_filter(): 2.97 seconds/10000 iterations. 0.000297 seconds/iteration.
  39. foreach : 4.29 seconds/10000 iterations. 0.000429 seconds/iteration.
  40. reduce @deceze: 9.66 seconds/10000 iterations. 0.000966 seconds/iteration.
  41. reduce @axiac : 11.42 seconds/10000 iterations. 0.001142 seconds/iteration.
  42.  
  43. ======== php bench.php 11000 9090 =============
  44. Generating 11000 elements... Done. Time: 0.009578 seconds.
  45. array_filter(): 138.72 seconds/9090 iterations. 0.015261 seconds/iteration.
  46. foreach : 7.73 seconds/9090 iterations. 0.000850 seconds/iteration.
  47. reduce @deceze: 12.11 seconds/9090 iterations. 0.001332 seconds/iteration.
  48. reduce @axiac : 12.65 seconds/9090 iterations. 0.001392 seconds/iteration.
  49.  
  50. ======== php bench.php 12000 8333 =============
  51. Generating 12000 elements... Done. Time: 0.003138 seconds.
  52. array_filter(): 115.33 seconds/8333 iterations. 0.013840 seconds/iteration.
  53. foreach : 7.28 seconds/8333 iterations. 0.000874 seconds/iteration.
  54. reduce @deceze: 11.17 seconds/8333 iterations. 0.001340 seconds/iteration.
  55. reduce @axiac : 13.80 seconds/8333 iterations. 0.001656 seconds/iteration.
  56.  
  57. ======== php bench.php 13000 7692 =============
  58. Generating 13000 elements... Done. Time: 0.016499 seconds.
  59. array_filter(): 126.54 seconds/7692 iterations. 0.016451 seconds/iteration.
  60. foreach : 8.81 seconds/7692 iterations. 0.001146 seconds/iteration.
  61. reduce @deceze: 11.61 seconds/7692 iterations. 0.001509 seconds/iteration.
  62. reduce @axiac : 12.88 seconds/7692 iterations. 0.001674 seconds/iteration.
  63.  
  64. ======== php bench.php 14000 7142 =============
  65. Generating 14000 elements... Done. Time: 0.058684 seconds.
  66. array_filter(): 3.20 seconds/7142 iterations. 0.000448 seconds/iteration.
  67. foreach : 8.08 seconds/7142 iterations. 0.001131 seconds/iteration.
  68. reduce @deceze: 11.61 seconds/7142 iterations. 0.001625 seconds/iteration.
  69. reduce @axiac : 12.67 seconds/7142 iterations. 0.001774 seconds/iteration.
  70.  
  71. ======== php bench.php 15000 6666 =============
  72. Generating 15000 elements... Done. Time: 0.011050 seconds.
  73. array_filter(): 3.38 seconds/6666 iterations. 0.000506 seconds/iteration.
  74. foreach : 9.86 seconds/6666 iterations. 0.001479 seconds/iteration.
  75. reduce @deceze: 12.14 seconds/6666 iterations. 0.001821 seconds/iteration.
  76. reduce @axiac : 12.89 seconds/6666 iterations. 0.001934 seconds/iteration.
  77.  
  78. ======== php bench.php 16000 6250 =============
  79. Generating 16000 elements... Done. Time: 0.004187 seconds.
  80. array_filter(): 3.31 seconds/6250 iterations. 0.000530 seconds/iteration.
  81. foreach : 10.08 seconds/6250 iterations. 0.001612 seconds/iteration.
  82. reduce @deceze: 13.12 seconds/6250 iterations. 0.002099 seconds/iteration.
  83. reduce @axiac : 13.23 seconds/6250 iterations. 0.002117 seconds/iteration.
  84.  
  85. ======== php bench.php 17000 5882 =============
  86. Generating 17000 elements... Done. Time: 0.013903 seconds.
  87. array_filter(): 181.47 seconds/5882 iterations. 0.030852 seconds/iteration.
  88. foreach : 10.76 seconds/5882 iterations. 0.001829 seconds/iteration.
  89. reduce @deceze: 14.97 seconds/5882 iterations. 0.002544 seconds/iteration.
  90. reduce @axiac : 13.62 seconds/5882 iterations. 0.002316 seconds/iteration.
  91.  
  92. ======== php bench.php 18000 5555 =============
  93. Generating 18000 elements... Done. Time: 0.004900 seconds.
  94. array_filter(): 86.37 seconds/5555 iterations. 0.015548 seconds/iteration.
  95. foreach : 11.56 seconds/5555 iterations. 0.002082 seconds/iteration.
  96. reduce @deceze: 15.53 seconds/5555 iterations. 0.002795 seconds/iteration.
  97. reduce @axiac : 12.99 seconds/5555 iterations. 0.002338 seconds/iteration.
  98.  
  99. ======== php bench.php 19000 5263 =============
  100. Generating 19000 elements... Done. Time: 0.071231 seconds.
  101. array_filter(): 94.65 seconds/5263 iterations. 0.017984 seconds/iteration.
  102. foreach : 11.13 seconds/5263 iterations. 0.002115 seconds/iteration.
  103. reduce @deceze: 15.60 seconds/5263 iterations. 0.002963 seconds/iteration.
  104. reduce @axiac : 13.26 seconds/5263 iterations. 0.002520 seconds/iteration.
  105.  
  106. ======== php bench.php 20000 5000 =============
  107. Generating 20000 elements... Done. Time: 0.013911 seconds.
  108. array_filter(): 83.37 seconds/5000 iterations. 0.016673 seconds/iteration.
  109. foreach : 14.88 seconds/5000 iterations. 0.002975 seconds/iteration.
  110. reduce @deceze: 21.42 seconds/5000 iterations. 0.004283 seconds/iteration.
  111. reduce @axiac : 15.45 seconds/5000 iterations. 0.003090 seconds/iteration.
  112.  
  113.  
  114. ------ starting here, the total number of visited items is 10,000,000 ------
  115. ------ it is 10 times larger in the above tests ------
  116. ------ but it took too long to complete for larger lists ------
  117.  
  118. ======== php bench.php 25000 400 =============
  119. Generating 25000 elements... Done. Time: 0.019150 seconds.
  120. array_filter(): 5.35 seconds/400 iterations. 0.013383 seconds/iteration.
  121. foreach : 1.49 seconds/400 iterations. 0.003714 seconds/iteration.
  122. reduce @deceze: 1.83 seconds/400 iterations. 0.004571 seconds/iteration.
  123. reduce @axiac : 1.39 seconds/400 iterations. 0.003466 seconds/iteration.
  124.  
  125. ======== php bench.php 30000 333 =============
  126. Generating 30000 elements... Done. Time: 0.069674 seconds.
  127. array_filter(): 5.27 seconds/333 iterations. 0.015839 seconds/iteration.
  128. foreach : 1.53 seconds/333 iterations. 0.004598 seconds/iteration.
  129. reduce @deceze: 1.89 seconds/333 iterations. 0.005687 seconds/iteration.
  130. reduce @axiac : 1.43 seconds/333 iterations. 0.004288 seconds/iteration.
  131.  
  132. ======== php bench.php 35000 285 =============
  133. Generating 35000 elements... Done. Time: 0.088461 seconds.
  134. array_filter(): 15.72 seconds/285 iterations. 0.055163 seconds/iteration.
  135. foreach : 1.94 seconds/285 iterations. 0.006794 seconds/iteration.
  136. reduce @deceze: 2.22 seconds/285 iterations. 0.007798 seconds/iteration.
  137. reduce @axiac : 1.49 seconds/285 iterations. 0.005242 seconds/iteration.
  138.  
  139. ======== php bench.php 40000 250 =============
  140. Generating 40000 elements... Done. Time: 0.111118 seconds.
  141. array_filter(): 8.06 seconds/250 iterations. 0.032222 seconds/iteration.
  142. foreach : 1.68 seconds/250 iterations. 0.006717 seconds/iteration.
  143. reduce @deceze: 1.96 seconds/250 iterations. 0.007827 seconds/iteration.
  144. reduce @axiac : 1.62 seconds/250 iterations. 0.006465 seconds/iteration.
  145.  
  146. ======== php bench.php 45000 222 =============
  147. Generating 45000 elements... Done. Time: 0.149520 seconds.
  148. array_filter(): 7.20 seconds/222 iterations. 0.032454 seconds/iteration.
  149. foreach : 1.60 seconds/222 iterations. 0.007207 seconds/iteration.
  150. reduce @deceze: 1.94 seconds/222 iterations. 0.008759 seconds/iteration.
  151. reduce @axiac : 1.47 seconds/222 iterations. 0.006628 seconds/iteration.
  152.  
  153. ======== php bench.php 50000 200 =============
  154. Generating 50000 elements... Done. Time: 0.026964 seconds.
  155. array_filter(): 5.63 seconds/200 iterations. 0.028164 seconds/iteration.
  156. foreach : 1.62 seconds/200 iterations. 0.008113 seconds/iteration.
  157. reduce @deceze: 2.03 seconds/200 iterations. 0.010168 seconds/iteration.
  158. reduce @axiac : 1.60 seconds/200 iterations. 0.007978 seconds/iteration.
  159.  
  160. ======== php bench.php 60000 166 =============
  161. Generating 60000 elements... Done. Time: 0.017754 seconds.
  162. array_filter(): 5.52 seconds/166 iterations. 0.033273 seconds/iteration.
  163. foreach : 1.79 seconds/166 iterations. 0.010795 seconds/iteration.
  164. reduce @deceze: 1.93 seconds/166 iterations. 0.011601 seconds/iteration.
  165. reduce @axiac : 1.56 seconds/166 iterations. 0.009406 seconds/iteration.
  166.  
  167. ======== php bench.php 70000 142 =============
  168. Generating 70000 elements... Done. Time: 0.262807 seconds.
  169. array_filter(): 16.87 seconds/142 iterations. 0.118804 seconds/iteration.
  170. foreach : 1.58 seconds/142 iterations. 0.011128 seconds/iteration.
  171. reduce @deceze: 2.16 seconds/142 iterations. 0.015178 seconds/iteration.
  172. reduce @axiac : 1.57 seconds/142 iterations. 0.011026 seconds/iteration.
  173.  
  174. ======== php bench.php 80000 125 =============
  175. Generating 80000 elements... Done. Time: 0.239714 seconds.
  176. array_filter(): 8.32 seconds/125 iterations. 0.066529 seconds/iteration.
  177. foreach : 1.59 seconds/125 iterations. 0.012730 seconds/iteration.
  178. reduce @deceze: 2.16 seconds/125 iterations. 0.017297 seconds/iteration.
  179. reduce @axiac : 1.83 seconds/125 iterations. 0.014678 seconds/iteration.
  180.  
  181. ======== php bench.php 90000 111 =============
  182. Generating 90000 elements... Done. Time: 0.025979 seconds.
  183. array_filter(): 11.23 seconds/111 iterations. 0.101183 seconds/iteration.
  184. foreach : 1.95 seconds/111 iterations. 0.017596 seconds/iteration.
  185. reduce @deceze: 2.41 seconds/111 iterations. 0.021679 seconds/iteration.
  186. reduce @axiac : 2.08 seconds/111 iterations. 0.018782 seconds/iteration.
  187.  
  188. ======== php bench.php 100000 100 =============
  189. Generating 100000 elements... Done. Time: 0.150742 seconds.
  190. array_filter(): 4.47 seconds/100 iterations. 0.044735 seconds/iteration.
  191. foreach : 2.21 seconds/100 iterations. 0.022068 seconds/iteration.
  192. reduce @deceze: 2.58 seconds/100 iterations. 0.025810 seconds/iteration.
  193. reduce @axiac : 1.95 seconds/100 iterations. 0.019500 seconds/iteration.
Add Comment
Please, Sign In to add comment