From: Jérémie Astor Date: Wed, 1 Apr 2020 21:33:01 +0000 (+0200) Subject: :white_check_mark: Update benchmark X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=009588dbc34e9e187d65e007e3e4608e7c96a94f;p=gwion.git :white_check_mark: Update benchmark --- diff --git a/benchmark/binary-trees.gw b/benchmark/binary-trees.gw index af3486c1..d92c5e0e 100644 --- a/benchmark/binary-trees.gw +++ b/benchmark/binary-trees.gw @@ -2,7 +2,7 @@ class Tree { int item; - Tree @left, right; + Tree ref left, right; fun static Tree new_Tree(int it, int depth) { Tree t; @@ -30,7 +30,7 @@ maxDepth + 1 => int stretchDepth; <<< "stretch tree of depth ", stretchDepth, " check: ", Tree.new_Tree(0, stretchDepth).check() >>>; -Tree.new_Tree(0, maxDepth) @=> Tree@ longLivedTree; +Tree.new_Tree(0, maxDepth) @=> Tree ref longLivedTree; #! iterations = 2 ** maxDepth 1 => int iterations; diff --git a/benchmark/fib-recurs.gw b/benchmark/fib-recurs.gw index be2c4ab7..197eec5f 100644 --- a/benchmark/fib-recurs.gw +++ b/benchmark/fib-recurs.gw @@ -4,5 +4,4 @@ fun int recursive_fib(int n) { else return recursive_fib(n - 2) + recursive_fib(n - 1); } -#!<<< 5 => recursive_fib >>>; <<< 40 => recursive_fib >>>; diff --git a/benchmark/fib.gw b/benchmark/fib.ck similarity index 100% rename from benchmark/fib.gw rename to benchmark/fib.ck diff --git a/benchmark/for.ck b/benchmark/for.ck new file mode 100644 index 00000000..e1ca6ed1 --- /dev/null +++ b/benchmark/for.ck @@ -0,0 +1,10 @@ +int list[0]; + +for (int i; i < 1000000; ++i) + list << i; + +int sum; +for (int i; i < list.size(); ++i) + i +=> sum; + +<<< sum >>>; diff --git a/benchmark/string-equals.gw b/benchmark/string-equals.gw index 6dfa7e62..6b197e1e 100644 --- a/benchmark/string-equals.gw +++ b/benchmark/string-equals.gw @@ -9,7 +9,7 @@ for (int i; i < 1000000; ++i) { if ("" == "abc") ++count; if ("abc" == "abcd") ++count; if ("changed one character" == "changed !ne character") ++count; -#! if ("123" == 123) ++count + if (`${123}` == "123") ++count; if ("a slightly longer string" == "a slightly longer string!") ++count; if ("a slightly longer string" ==