Advertisement
Guest User

Jebawka - Twój język jest chujowy 0.6.0

a guest
Jul 12th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- PYTHON 2.7.8 --
  2. real 0m1.020s
  3. real 0m1.046s
  4. real 0m1.248s
  5. real 0m1.209s
  6. real 0m1.228s
  7. real 0m1.136s
  8. real 0m1.146s
  9. real 0m1.197s
  10. real 0m1.200s
  11. real 0m1.181s
  12. real 0m1.166s
  13.  
  14. -- PYTHON 3.4.1 --
  15. real 0m1.088s
  16. real 0m1.080s
  17. real 0m1.074s
  18. real 0m1.086s
  19. real 0m1.139s
  20. real 0m1.113s
  21. real 0m1.069s
  22. real 0m1.076s
  23. real 0m1.056s
  24. real 0m1.075s
  25. real 0m1.326s
  26.  
  27. -- RUBY 2.1.3p242 --
  28. real 0m0.952s
  29. real 0m0.950s
  30. real 0m1.113s
  31. real 0m1.079s
  32. real 0m1.073s
  33. real 0m1.107s
  34. real 0m1.087s
  35. real 0m1.128s
  36. real 0m1.075s
  37. real 0m1.081s
  38. real 0m1.092s
  39.  
  40. -- PHP 5.6.1 --
  41. real 0m1.241s
  42. real 0m1.239s
  43. real 0m1.351s
  44. real 0m1.378s
  45. real 0m1.345s
  46. real 0m1.445s
  47. real 0m1.372s
  48. real 0m1.401s
  49. real 0m1.567s
  50. real 0m1.352s
  51. real 0m1.404s
  52.  
  53. -- HHVM 3.7.3 --
  54. real 0m1.509s
  55. real 0m1.525s
  56. real 0m1.569s
  57. real 0m1.582s
  58. real 0m1.540s
  59. real 0m1.552s
  60. real 0m1.567s
  61. real 0m1.579s
  62. real 0m1.576s
  63. real 0m1.553s
  64. real 0m1.525s
  65.  
  66. -- Java 1.8.0_45 --
  67. real 0m0.346s
  68. real 0m0.340s
  69. real 0m0.338s
  70. real 0m0.339s
  71. real 0m0.337s
  72. real 0m0.337s
  73. real 0m0.341s
  74. real 0m0.340s
  75. real 0m0.337s
  76. real 0m0.333s
  77. real 0m0.341s
  78.  
  79. -- Scala 2.11.7 --
  80. real 0m0.499s
  81. real 0m0.504s
  82. real 0m0.508s
  83. real 0m0.503s
  84. real 0m0.508s
  85. real 0m0.506s
  86. real 0m0.515s
  87. real 0m0.508s
  88. real 0m0.502s
  89. real 0m0.502s
  90. real 0m0.507s
  91.  
  92. -- Node.js 0.12.4 --
  93. real 0m1.851s
  94. real 0m1.872s
  95. real 0m1.964s
  96. real 0m1.949s
  97. real 0m1.931s
  98. real 0m1.942s
  99. real 0m1.966s
  100. real 0m1.953s
  101. real 0m1.972s
  102. real 0m2.088s
  103. real 0m1.967s
  104.  
  105. -- Io.js 2.3.1 --
  106. real 0m1.973s
  107. real 0m1.758s
  108. real 0m1.823s
  109. real 0m1.766s
  110. real 0m1.759s
  111. real 0m1.768s
  112. real 0m1.716s
  113. real 0m1.786s
  114. real 0m1.803s
  115. real 0m1.758s
  116. real 0m1.737s
  117.  
  118. -- SOURCES --
  119.  
  120. $ cat test.py
  121.  
  122. #!/usr/bin/env python
  123.  
  124. f = open('python.txt', 'w')
  125. for i in range(1, 1000000):
  126. f.write ("%d\t%d\n" % (i, i**2))
  127. f.close()
  128.  
  129. $ cat test.py3
  130.  
  131. #!/usr/bin/env python3
  132.  
  133. f = open('python.txt', 'w')
  134. for i in range(1, 1000000):
  135. f.write ("%d\t%d\n" % (i, i**2))
  136. f.close()
  137.  
  138. $ cat test.rb
  139.  
  140. #!/usr/bin/env ruby
  141.  
  142. f = open('ruby.txt', 'w')
  143. for i in 1...1000000
  144. f.puts sprintf("%d\t%d", i, i**2)
  145. end
  146. f.close
  147.  
  148. $ cat test.php
  149.  
  150. #!/usr/bin/env php
  151.  
  152. <?php
  153.  
  154. $f = fopen('php.txt', 'w');
  155. for ($i = 0; $i < 1000000; $i++) {
  156. fwrite($f, $i."\t".$i**2);
  157. }
  158. fclose($f);
  159.  
  160. $ cat test.hh
  161.  
  162. <?php
  163.  
  164. $f = fopen('hack.txt', 'w');
  165. for ($i = 0; $i < 1000000; $i++) {
  166. fwrite($f, $i."\t".$i**2);
  167. }
  168. fclose($f);
  169.  
  170. $ cat BenchmarkingTestCaseLongNamedClassBecauseJavaIsVerboseForTheWin.java
  171.  
  172. import java.io.File;
  173. import java.io.FileWriter;
  174. import java.io.IOException;
  175.  
  176. public class BenchmarkingTestCaseLongNamedClassBecauseJavaIsVerboseForTheWin {
  177.  
  178. public static void main(String[] args)
  179. {
  180. FileWriter fw = null;
  181.  
  182. try {
  183. File file = new File("java.txt");
  184. fw = new FileWriter(file, true);
  185.  
  186. for (long i = 0; i < 1000000; i++) {
  187. fw.write(String.valueOf(i) + "\t" + String.valueOf(Math.pow(i, 2))); // String.format() is very slow
  188. }
  189.  
  190. } catch (IOException ex) {
  191. ex.printStackTrace();
  192. } finally {
  193. if (fw != null) {
  194. try {
  195. fw.close();
  196. } catch (IOException ex) {
  197. ex.printStackTrace();
  198. }
  199. }
  200. }
  201. }
  202.  
  203. }
  204.  
  205. $ cat test.scala
  206.  
  207. import java.io._
  208.  
  209. object Test {
  210. def main(args: Array[String]):Unit = {
  211. val fw = new FileWriter("scala.txt")
  212. var i = 0;
  213. while (i < 1000000) {
  214. fw.write( String.valueOf(i) + "\t" + String.valueOf(Math.pow(i,2)) )
  215. i += 1;
  216. }
  217. fw.close
  218. }
  219.  
  220. }
  221.  
  222. $ cat test.js
  223.  
  224. var fs = require('fs')
  225. var fd = fs.openSync('node.txt', 'w')
  226.  
  227. for (var i = 0; i < 1000000; i++) {
  228. fs.writeSync(fd, i+"\t"+Math.pow(i,2))
  229. }
  230.  
  231. fs.closeSync(fd)
  232.  
  233.  
  234. -- BENCHMARK SCRIPT --
  235.  
  236. $ cat bench.sh
  237.  
  238. #!/bin/bash
  239.  
  240. echo "-- PYTHON 2.7.8 --"
  241. for ((x = 0 ; x <= 10 ; x++)); do
  242. (time ./test.py) 2>&1 > /dev/null | grep real
  243. done
  244.  
  245. echo ""
  246.  
  247. echo "-- PYTHON 3.4.1 --"
  248. for ((x = 0 ; x <= 10 ; x++)); do
  249. (time ./test.py3) 2>&1 > /dev/null | grep real
  250. done
  251.  
  252. echo ""
  253.  
  254. echo "-- RUBY 2.1.3p242 --"
  255. for ((x = 0 ; x <= 10 ; x++)); do
  256. (time ./test.rb) 2>&1 > /dev/null | grep real
  257. done
  258.  
  259. echo ""
  260.  
  261. echo "-- PHP 5.6.1 --"
  262. for ((x = 0 ; x <= 10 ; x++)); do
  263. (time ./test.php) 2>&1 > /dev/null | grep real
  264. done
  265.  
  266. echo ""
  267.  
  268. echo "-- HHVM 3.7.3 --"
  269. for ((x = 0 ; x <= 10 ; x++)); do
  270. (time hhvm -v Eval.Jit=0 -v Eval.JitProfileInterpRequests=0 test.hh) 2>&1 > /dev/null | grep real
  271. done
  272.  
  273. echo ""
  274.  
  275. echo "-- Java 1.8.0_45 --"
  276. javac BenchmarkingTestCaseLongNamedClassBecauseJavaIsVerboseForTheWin.java
  277. for ((x = 0 ; x <= 10 ; x++)); do
  278. (time java BenchmarkingTestCaseLongNamedClassBecauseJavaIsVerboseForTheWin) 2>&1 > /dev/null | grep real
  279. done
  280.  
  281. echo ""
  282.  
  283. echo "-- Scala 2.11.7 --"
  284. scalac test.scala
  285. for ((x = 0 ; x <= 10 ; x++)); do
  286. (time scala Test) 2>&1 > /dev/null | grep real
  287. done
  288.  
  289. echo ""
  290.  
  291. echo "-- Node.js 0.12.4 --"
  292. for ((x = 0 ; x <= 10 ; x++)); do
  293. (time node test.js) 2>&1 > /dev/null | grep real
  294. done
  295.  
  296. echo ""
  297.  
  298. echo "-- Io.js 2.3.1 --"
  299. for ((x = 0 ; x <= 10 ; x++)); do
  300. (time iojs test.js) 2>&1 > /dev/null | grep real
  301. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement