From: fennecdjay Date: Tue, 2 Jul 2019 21:17:19 +0000 (+0200) Subject: :art: More benchmarks X-Git-Tag: nightly~2382^2~1 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ca3dda4080274a3306dd158994cca6fa3a136792;p=gwion.git :art: More benchmarks --- diff --git a/docs/Benchmarks.mdr b/docs/Benchmarks.mdr index 274ce59d..0f81e941 100644 --- a/docs/Benchmarks.mdr +++ b/docs/Benchmarks.mdr @@ -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 @``` diff --git a/docs/assets/benchmark/binary-trees.dat b/docs/assets/benchmark/binary-trees.dat new file mode 100644 index 00000000..2d13d935 --- /dev/null +++ b/docs/assets/benchmark/binary-trees.dat @@ -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 index 00000000..8bf59bca 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 index a8dc8e81..00000000 --- a/docs/assets/benchmark/binary_trees.dat +++ /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 index ea48d1cc..00000000 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 index 00000000..ad47b5da --- /dev/null +++ b/docs/assets/benchmark/fib-recurs.dat @@ -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 index 00000000..a0637217 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 index 00000000..5f73c7cd --- /dev/null +++ b/docs/assets/benchmark/fib.dat @@ -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 index 00000000..8bbc056b 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 index 00000000..083d19cb --- /dev/null +++ b/docs/assets/benchmark/method-call.dat @@ -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 index 00000000..d23c6ad5 Binary files /dev/null and b/docs/assets/benchmark/method-call.png differ diff --git a/tests/benchmark/binary_trees_gc.wren b/tests/benchmark/binary-trees-gc.wren similarity index 100% rename from tests/benchmark/binary_trees_gc.wren rename to tests/benchmark/binary-trees-gc.wren diff --git a/tests/benchmark/binary_trees.dart b/tests/benchmark/binary-trees.dart similarity index 100% rename from tests/benchmark/binary_trees.dart rename to tests/benchmark/binary-trees.dart diff --git a/tests/benchmark/binary_trees.gw b/tests/benchmark/binary-trees.gw similarity index 100% rename from tests/benchmark/binary_trees.gw rename to tests/benchmark/binary-trees.gw diff --git a/tests/benchmark/binary_trees.lua b/tests/benchmark/binary-trees.lua similarity index 100% rename from tests/benchmark/binary_trees.lua rename to tests/benchmark/binary-trees.lua diff --git a/tests/benchmark/binary_trees.py b/tests/benchmark/binary-trees.py similarity index 100% rename from tests/benchmark/binary_trees.py rename to tests/benchmark/binary-trees.py diff --git a/tests/benchmark/binary_trees.rb b/tests/benchmark/binary-trees.rb similarity index 100% rename from tests/benchmark/binary_trees.rb rename to tests/benchmark/binary-trees.rb diff --git a/tests/benchmark/binary_trees.wren b/tests/benchmark/binary-trees.wren similarity index 100% rename from tests/benchmark/binary_trees.wren rename to tests/benchmark/binary-trees.wren diff --git a/tests/benchmark/fib.dart b/tests/benchmark/fib.dart new file mode 100644 index 00000000..3ffa670b --- /dev/null +++ b/tests/benchmark/fib.dart @@ -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 index 00000000..9c78eb29 --- /dev/null +++ b/tests/benchmark/fib.gw @@ -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) + <<>>; diff --git a/tests/benchmark/fib.lua b/tests/benchmark/fib.lua new file mode 100644 index 00000000..a4f06e7c --- /dev/null +++ b/tests/benchmark/fib.lua @@ -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 index 00000000..c2f3ba4d --- /dev/null +++ b/tests/benchmark/fib.py @@ -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 index 00000000..c496913b --- /dev/null +++ b/tests/benchmark/fib.rb @@ -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 index 00000000..441a7e69 --- /dev/null +++ b/tests/benchmark/fib.wren @@ -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)) +} diff --git a/tests/benchmark/method_call.ck b/tests/benchmark/method-call.ck similarity index 100% rename from tests/benchmark/method_call.ck rename to tests/benchmark/method-call.ck diff --git a/tests/benchmark/method_call.dart b/tests/benchmark/method-call.dart similarity index 100% rename from tests/benchmark/method_call.dart rename to tests/benchmark/method-call.dart diff --git a/tests/benchmark/method_call.gw b/tests/benchmark/method-call.gw similarity index 100% rename from tests/benchmark/method_call.gw rename to tests/benchmark/method-call.gw diff --git a/tests/benchmark/method_call.lua b/tests/benchmark/method-call.lua similarity index 100% rename from tests/benchmark/method_call.lua rename to tests/benchmark/method-call.lua diff --git a/tests/benchmark/method_call.py b/tests/benchmark/method-call.py similarity index 100% rename from tests/benchmark/method_call.py rename to tests/benchmark/method-call.py diff --git a/tests/benchmark/method_call.rb b/tests/benchmark/method-call.rb similarity index 100% rename from tests/benchmark/method_call.rb rename to tests/benchmark/method-call.rb diff --git a/tests/benchmark/method_call.wren b/tests/benchmark/method-call.wren similarity index 100% rename from tests/benchmark/method_call.wren rename to tests/benchmark/method-call.wren