diff --git a/test/bench/results.md b/test/bench/results.md index 26b000b4..8858d760 100644 --- a/test/bench/results.md +++ b/test/bench/results.md @@ -25,7 +25,11 @@ language | loop | hello | itos | add | call c | 0,0500 | 2,1365 | 0,2902 | 0,1245 | 0,8535 soml | 0,0374 | 1,2071 | 0,7263 | 0,2247 | 1,3625 -ratio | 1,3368 | 1,7699 | 0,3996 | 0,5541 | 0,6264 - | 0,7480 | 0,5650 | 2,5028 | 1,8048 | 1,5964 +ruby | 0,3 | 8.882 | 0,8971 | 3,8452 2c | - 33 % | - 79 % | + 150% | + 80 % | + 60 % + +2r | x 10 | x 6 | + 23% | x 17 | x 26 + +Comparison with ruby, not really for speed, just to see how much leeway there is for our next layer. +Ruby startup time is 1,5695 seconds, which we'll subtract from the benches diff --git a/test/bench/ruby/adds.rb b/test/bench/ruby/adds.rb new file mode 100644 index 00000000..b4fb2b02 --- /dev/null +++ b/test/bench/ruby/adds.rb @@ -0,0 +1,19 @@ +def fibo( n) + a = 0 + b = 1 + i = 1 + while( i < n ) do + result = a + b + a = b + b = result + i+= 1 + end + return result +end + + counter = 100000 + +while(counter > 0) do + fibo(40) + counter -= 1 +end diff --git a/test/bench/ruby/calls.rb b/test/bench/ruby/calls.rb new file mode 100644 index 00000000..1b1274e7 --- /dev/null +++ b/test/bench/ruby/calls.rb @@ -0,0 +1,16 @@ + +def fibo_r( n ) + if( n < 2 ) + return n + else + return fibo_r(n - 1) + fibo_r(n - 2) + end +end + + + counter = 1000 + + while(counter > 0) do + fibo_r(20) + counter -= 1 + end diff --git a/test/bench/ruby/hello.rb b/test/bench/ruby/hello.rb new file mode 100644 index 00000000..a7e30f7c --- /dev/null +++ b/test/bench/ruby/hello.rb @@ -0,0 +1,7 @@ + +counter = 100352 - 352; +while(counter > 0) do + puts "Hello there" + STDOUT.flush + counter = counter - 1 +end diff --git a/test/bench/ruby/itos.rb b/test/bench/ruby/itos.rb new file mode 100644 index 00000000..c7e2db92 --- /dev/null +++ b/test/bench/ruby/itos.rb @@ -0,0 +1,8 @@ + + +counter = 100352 - 352 +while(counter > 0) do + str = counter.to_s + counter = counter - 1 +end +str diff --git a/test/bench/ruby/loop.rb b/test/bench/ruby/loop.rb new file mode 100644 index 00000000..5a89d936 --- /dev/null +++ b/test/bench/ruby/loop.rb @@ -0,0 +1,5 @@ + +counter = 100000 +while(counter > 0) do + counter = counter - 1 +end diff --git a/test/bench/runner.rb b/test/bench/runner.rb index 5abc2f56..2d998dd8 100644 --- a/test/bench/runner.rb +++ b/test/bench/runner.rb @@ -23,7 +23,7 @@ end class Runner def initialize @stats = Stats.new - @cmd = ARGV[0] + @cmd = ARGV.join(" ") end def run while true diff --git a/test/bench/ruby/helper.rb b/test/bench/soml/helper.rb similarity index 100% rename from test/bench/ruby/helper.rb rename to test/bench/soml/helper.rb diff --git a/test/bench/ruby/test_integer.rb b/test/bench/soml/test_integer.rb similarity index 100% rename from test/bench/ruby/test_integer.rb rename to test/bench/soml/test_integer.rb diff --git a/test/bench/ruby/test_word.rb b/test/bench/soml/test_word.rb similarity index 100% rename from test/bench/ruby/test_word.rb rename to test/bench/soml/test_word.rb