]> Nishi Git Mirror - gwion.git/commitdiff
:art: More benchmarks
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 2 Jul 2019 21:17:19 +0000 (23:17 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 2 Jul 2019 21:17:19 +0000 (23:17 +0200)
31 files changed:
docs/Benchmarks.mdr
docs/assets/benchmark/binary-trees.dat [new file with mode: 0644]
docs/assets/benchmark/binary-trees.png [new file with mode: 0644]
docs/assets/benchmark/binary_trees.dat [deleted file]
docs/assets/benchmark/binary_trees.png [deleted file]
docs/assets/benchmark/fib-recurs.dat [new file with mode: 0644]
docs/assets/benchmark/fib-recurs.png [new file with mode: 0644]
docs/assets/benchmark/fib.dat [new file with mode: 0644]
docs/assets/benchmark/fib.png [new file with mode: 0644]
docs/assets/benchmark/method-call.dat [new file with mode: 0644]
docs/assets/benchmark/method-call.png [new file with mode: 0644]
tests/benchmark/binary-trees-gc.wren [moved from tests/benchmark/binary_trees_gc.wren with 100% similarity]
tests/benchmark/binary-trees.dart [moved from tests/benchmark/binary_trees.dart with 100% similarity]
tests/benchmark/binary-trees.gw [moved from tests/benchmark/binary_trees.gw with 100% similarity]
tests/benchmark/binary-trees.lua [moved from tests/benchmark/binary_trees.lua with 100% similarity]
tests/benchmark/binary-trees.py [moved from tests/benchmark/binary_trees.py with 100% similarity]
tests/benchmark/binary-trees.rb [moved from tests/benchmark/binary_trees.rb with 100% similarity]
tests/benchmark/binary-trees.wren [moved from tests/benchmark/binary_trees.wren with 100% similarity]
tests/benchmark/fib.dart [new file with mode: 0644]
tests/benchmark/fib.gw [new file with mode: 0644]
tests/benchmark/fib.lua [new file with mode: 0644]
tests/benchmark/fib.py [new file with mode: 0644]
tests/benchmark/fib.rb [new file with mode: 0644]
tests/benchmark/fib.wren [new file with mode: 0644]
tests/benchmark/method-call.ck [moved from tests/benchmark/method_call.ck with 100% similarity]
tests/benchmark/method-call.dart [moved from tests/benchmark/method_call.dart with 100% similarity]
tests/benchmark/method-call.gw [moved from tests/benchmark/method_call.gw with 100% similarity]
tests/benchmark/method-call.lua [moved from tests/benchmark/method_call.lua with 100% similarity]
tests/benchmark/method-call.py [moved from tests/benchmark/method_call.py with 100% similarity]
tests/benchmark/method-call.rb [moved from tests/benchmark/method_call.rb with 100% similarity]
tests/benchmark/method-call.wren [moved from tests/benchmark/method_call.wren with 100% similarity]

index 274ce59d4009778fa918a8f46f0f94badca9d479..0f81e9415df378c208487a96d5adbaea61bd2c57 100644 (file)
@@ -62,9 +62,9 @@ if (!exists("test_dir"))
 dat_name = sprintf("docs/assets/benchmark/%s.dat", bench)
 
 stats dat_name using 0:2 noout
-max = ceil(STATS_max_y+2)
+max = STATS_max_y+(0.1*STATS_max_y)
 
-#set title bench
+set title bench
 set output sprintf("docs/assets/benchmark/%s.png", bench)
 set xrange [-0.5:((ceil(STATS_max_x))+0.5)]
 set yrange [0:max]
@@ -76,8 +76,8 @@ set ytics nomirror
 set style fill transparent solid 0.25 # partial transparency
 set style fill noborder # no separate top/bottom lines
 
-plot dat_name using 0:2:($3/100.):xtic(2) with boxerrorbar lc "blue" notitle, \
-  '' using 0:(max-0.5):1 with labels
+plot dat_name using 0:2:($2*($3/100.0)):xtic(2) with boxerrorbar lc "blue" notitle, \
+  '' using 0:(max-(0.05*max)):1 with labels
 @```  
 </a></a></li></ul></ul></div>
 
diff --git a/docs/assets/benchmark/binary-trees.dat b/docs/assets/benchmark/binary-trees.dat
new file mode 100644 (file)
index 0000000..2d13d93
--- /dev/null
@@ -0,0 +1,3 @@
+gwion 0.188183 0.30
+wren 0.237885 0.33
+lua 0.32730 2.38
diff --git a/docs/assets/benchmark/binary-trees.png b/docs/assets/benchmark/binary-trees.png
new file mode 100644 (file)
index 0000000..8bf59bc
Binary files /dev/null and b/docs/assets/benchmark/binary-trees.png differ
diff --git a/docs/assets/benchmark/binary_trees.dat b/docs/assets/benchmark/binary_trees.dat
deleted file mode 100644 (file)
index a8dc8e8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-gwion 0.244813625 0.33
-wren 0.358684268 1.43
-lua5.3 0.621848489 5.69
diff --git a/docs/assets/benchmark/binary_trees.png b/docs/assets/benchmark/binary_trees.png
deleted file mode 100644 (file)
index ea48d1c..0000000
Binary files a/docs/assets/benchmark/binary_trees.png and /dev/null differ
diff --git a/docs/assets/benchmark/fib-recurs.dat b/docs/assets/benchmark/fib-recurs.dat
new file mode 100644 (file)
index 0000000..ad47b5d
--- /dev/null
@@ -0,0 +1,3 @@
+gwion 5.4589 0.43
+wren 13.4301 0.40
+lua 7.2227 0.22
diff --git a/docs/assets/benchmark/fib-recurs.png b/docs/assets/benchmark/fib-recurs.png
new file mode 100644 (file)
index 0000000..a063721
Binary files /dev/null and b/docs/assets/benchmark/fib-recurs.png differ
diff --git a/docs/assets/benchmark/fib.dat b/docs/assets/benchmark/fib.dat
new file mode 100644 (file)
index 0000000..5f73c7c
--- /dev/null
@@ -0,0 +1,3 @@
+gwion 0.086354 0.61
+wren 0.21780 0.55
+lua 0.219805 0.43
diff --git a/docs/assets/benchmark/fib.png b/docs/assets/benchmark/fib.png
new file mode 100644 (file)
index 0000000..8bbc056
Binary files /dev/null and b/docs/assets/benchmark/fib.png differ
diff --git a/docs/assets/benchmark/method-call.dat b/docs/assets/benchmark/method-call.dat
new file mode 100644 (file)
index 0000000..083d19c
--- /dev/null
@@ -0,0 +1,3 @@
+gwion 0.091682 0.31
+wren 0.107952 0.40
+lua 0.25460 1.10
diff --git a/docs/assets/benchmark/method-call.png b/docs/assets/benchmark/method-call.png
new file mode 100644 (file)
index 0000000..d23c6ad
Binary files /dev/null and b/docs/assets/benchmark/method-call.png differ
diff --git a/tests/benchmark/fib.dart b/tests/benchmark/fib.dart
new file mode 100644 (file)
index 0000000..3ffa670
--- /dev/null
@@ -0,0 +1,10 @@
+fib(n) {
+  if (n < 2) return n;
+  return fib(n - 1) + fib(n - 2);
+}
+
+main() {
+  for (var i = 0; i < 5; i++) {
+    print(fib(28));
+  }
+}
diff --git a/tests/benchmark/fib.gw b/tests/benchmark/fib.gw
new file mode 100644 (file)
index 0000000..9c78eb2
--- /dev/null
@@ -0,0 +1,8 @@
+class Fib {
+  fun static int get(int n) {
+    if (n < 2) return n;
+    return get(n - 1) + get(n - 2);
+  }
+}
+repeat(5)
+  <<<Fib.get(28)>>>;
diff --git a/tests/benchmark/fib.lua b/tests/benchmark/fib.lua
new file mode 100644 (file)
index 0000000..a4f06e7
--- /dev/null
@@ -0,0 +1,8 @@
+function fib(n)
+  if n < 2 then return n end
+  return fib(n - 2) + fib(n - 1)
+end
+
+for i = 1, 5 do
+  io.write(fib(28) .. "\n")
+end
diff --git a/tests/benchmark/fib.py b/tests/benchmark/fib.py
new file mode 100644 (file)
index 0000000..c2f3ba4
--- /dev/null
@@ -0,0 +1,8 @@
+from __future__ import print_function
+
+def fib(n):
+  if n < 2: return n
+  return fib(n - 1) + fib(n - 2)
+
+for i in range(0, 5):
+  print(fib(28))
diff --git a/tests/benchmark/fib.rb b/tests/benchmark/fib.rb
new file mode 100644 (file)
index 0000000..c496913
--- /dev/null
@@ -0,0 +1,11 @@
+def fib(n)
+  if n < 2 then
+    n
+  else
+    fib(n - 1) + fib(n - 2)
+  end
+end
+
+for i in 0...5
+  puts fib(28)
+end
diff --git a/tests/benchmark/fib.wren b/tests/benchmark/fib.wren
new file mode 100644 (file)
index 0000000..441a7e6
--- /dev/null
@@ -0,0 +1,10 @@
+class Fib {
+  static get(n) {
+    if (n < 2) return n
+    return get(n - 1) + get(n - 2)
+  }
+}
+
+for (i in 1..5) {
+  System.print(Fib.get(28))
+}