summaryrefslogtreecommitdiff
path: root/ruby_2_2/benchmark/other-lang
diff options
context:
space:
mode:
Diffstat (limited to 'ruby_2_2/benchmark/other-lang')
-rw-r--r--ruby_2_2/benchmark/other-lang/ack.pl11
-rw-r--r--ruby_2_2/benchmark/other-lang/ack.py16
-rw-r--r--ruby_2_2/benchmark/other-lang/ack.rb12
-rw-r--r--ruby_2_2/benchmark/other-lang/ack.scm7
-rw-r--r--ruby_2_2/benchmark/other-lang/eval.rb66
-rw-r--r--ruby_2_2/benchmark/other-lang/fact.pl13
-rw-r--r--ruby_2_2/benchmark/other-lang/fact.py18
-rw-r--r--ruby_2_2/benchmark/other-lang/fact.rb13
-rw-r--r--ruby_2_2/benchmark/other-lang/fact.scm8
-rw-r--r--ruby_2_2/benchmark/other-lang/fib.pl11
-rw-r--r--ruby_2_2/benchmark/other-lang/fib.py7
-rw-r--r--ruby_2_2/benchmark/other-lang/fib.rb9
-rw-r--r--ruby_2_2/benchmark/other-lang/fib.scm7
-rw-r--r--ruby_2_2/benchmark/other-lang/loop.pl3
-rw-r--r--ruby_2_2/benchmark/other-lang/loop.py2
-rw-r--r--ruby_2_2/benchmark/other-lang/loop.rb4
-rw-r--r--ruby_2_2/benchmark/other-lang/loop.scm1
-rw-r--r--ruby_2_2/benchmark/other-lang/loop2.rb1
-rw-r--r--ruby_2_2/benchmark/other-lang/tak.pl11
-rw-r--r--ruby_2_2/benchmark/other-lang/tak.py8
-rw-r--r--ruby_2_2/benchmark/other-lang/tak.rb13
-rw-r--r--ruby_2_2/benchmark/other-lang/tak.scm10
22 files changed, 0 insertions, 251 deletions
diff --git a/ruby_2_2/benchmark/other-lang/ack.pl b/ruby_2_2/benchmark/other-lang/ack.pl
deleted file mode 100644
index 201e22ddfa..0000000000
--- a/ruby_2_2/benchmark/other-lang/ack.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-use integer;
-
-sub Ack {
- return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1))
- : Ack($_[0]-1, 1))
- : $_[1]+1;
-}
-
-my $NUM = 9;
-$NUM = 1 if ($NUM < 1);
-my $ack = Ack(3, $NUM);
diff --git a/ruby_2_2/benchmark/other-lang/ack.py b/ruby_2_2/benchmark/other-lang/ack.py
deleted file mode 100644
index 9968e7cfcf..0000000000
--- a/ruby_2_2/benchmark/other-lang/ack.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import sys
-sys.setrecursionlimit(5000000)
-
-def Ack(M, N):
- if (not M):
- return( N + 1 )
- if (not N):
- return( Ack(M-1, 1) )
- return( Ack(M-1, Ack(M, N-1)) )
-
-def main():
- NUM = 9
- sys.setrecursionlimit(10000)
- Ack(3, NUM)
-
-main()
diff --git a/ruby_2_2/benchmark/other-lang/ack.rb b/ruby_2_2/benchmark/other-lang/ack.rb
deleted file mode 100644
index 7451bed6c4..0000000000
--- a/ruby_2_2/benchmark/other-lang/ack.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-def ack(m, n)
- if m == 0 then
- n + 1
- elsif n == 0 then
- ack(m - 1, 1)
- else
- ack(m - 1, ack(m, n - 1))
- end
-end
-
-NUM = 9
-ack(3, NUM)
diff --git a/ruby_2_2/benchmark/other-lang/ack.scm b/ruby_2_2/benchmark/other-lang/ack.scm
deleted file mode 100644
index a80b73ba55..0000000000
--- a/ruby_2_2/benchmark/other-lang/ack.scm
+++ /dev/null
@@ -1,7 +0,0 @@
-(define (ack m n)
- (cond ((zero? m) (+ n 1))
- ((zero? n) (ack (- m 1) 1))
- (else (ack (- m 1) (ack m (- n 1))))))
-
-(ack 3 9)
-
diff --git a/ruby_2_2/benchmark/other-lang/eval.rb b/ruby_2_2/benchmark/other-lang/eval.rb
deleted file mode 100644
index 48a2cea019..0000000000
--- a/ruby_2_2/benchmark/other-lang/eval.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-
-Bench = %w(
- loop
- ack
- fib
- tak
- fact
-)
-
-Lang = <<EOP.map{|l| l.strip}
- ruby-cyg
- ../../../test6/miniruby
- perl
- python
- gosh
-EOP
-
-Bench.replace ['loop2']
-Lang.replace ['ruby-cyg']
-
-Ext = %w(
- .rb
- .rb
- .pl
- .py
- .scm
-)
-
-p Bench
-p Lang
-
-require 'benchmark'
-
-def bench cmd
- m = Benchmark.measure{
- #p cmd
- system(cmd)
- }
- [m.utime, m.real]
-end
-
-Result = []
-Bench.each{|b|
- r = []
- Lang.each_with_index{|l, idx|
- cmd = "#{l} #{b}#{Ext[idx]}"
- r << bench(cmd)
- }
- Result << r
-}
-
-require 'pp'
-# utime
-puts Lang.join("\t")
-Bench.each_with_index{|b, bi|
- print b, "\t"
- puts Result[bi].map{|e| e[0]}.join("\t")
-}
-
-# rtime
-puts Lang.join("\t")
-Bench.each_with_index{|b, bi|
- print b, "\t"
- puts Result[bi].map{|e| e[1]}.join("\t")
-}
-
diff --git a/ruby_2_2/benchmark/other-lang/fact.pl b/ruby_2_2/benchmark/other-lang/fact.pl
deleted file mode 100644
index a9b0b69cdf..0000000000
--- a/ruby_2_2/benchmark/other-lang/fact.pl
+++ /dev/null
@@ -1,13 +0,0 @@
-sub fact{
- my $n = @_[0];
- if($n < 2){
- return 1;
- }
- else{
- return $n * fact($n-1);
- }
-}
-
-for($i=0; $i<10000; $i++){
- &fact(100);
-}
diff --git a/ruby_2_2/benchmark/other-lang/fact.py b/ruby_2_2/benchmark/other-lang/fact.py
deleted file mode 100644
index 01593965d9..0000000000
--- a/ruby_2_2/benchmark/other-lang/fact.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#import sys
-#sys.setrecursionlimit(1000)
-
-def factL(n):
- r = 1
- for x in range(2, n):
- r *= x
- return r
-
-def factR(n):
- if n < 2:
- return 1
- else:
- return n * factR(n-1)
-
-for i in range(10000):
- factR(100)
-
diff --git a/ruby_2_2/benchmark/other-lang/fact.rb b/ruby_2_2/benchmark/other-lang/fact.rb
deleted file mode 100644
index 6cedc752cd..0000000000
--- a/ruby_2_2/benchmark/other-lang/fact.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-def fact(n)
- if n < 2
- 1
- else
- n * fact(n-1)
- end
-end
-
-i = 0
-while i<10000
- i += 1
- fact(100)
-end
diff --git a/ruby_2_2/benchmark/other-lang/fact.scm b/ruby_2_2/benchmark/other-lang/fact.scm
deleted file mode 100644
index c98a7fedd3..0000000000
--- a/ruby_2_2/benchmark/other-lang/fact.scm
+++ /dev/null
@@ -1,8 +0,0 @@
-(define (fact n)
- (if (< n 2)
- 1
- (* n (fact (- n 1)))))
-
-(dotimes (i 10000)
- (fact 100))
-
diff --git a/ruby_2_2/benchmark/other-lang/fib.pl b/ruby_2_2/benchmark/other-lang/fib.pl
deleted file mode 100644
index a46f666d1e..0000000000
--- a/ruby_2_2/benchmark/other-lang/fib.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-sub fib{
- my $n = $_[0];
- if($n < 3){
- return 1;
- }
- else{
- return fib($n-1) + fib($n-2);
- }
-};
-
-&fib(34);
diff --git a/ruby_2_2/benchmark/other-lang/fib.py b/ruby_2_2/benchmark/other-lang/fib.py
deleted file mode 100644
index 45f2bceb8d..0000000000
--- a/ruby_2_2/benchmark/other-lang/fib.py
+++ /dev/null
@@ -1,7 +0,0 @@
-def fib(n):
- if n < 3:
- return 1
- else:
- return fib(n-1) + fib(n-2)
-
-fib(34)
diff --git a/ruby_2_2/benchmark/other-lang/fib.rb b/ruby_2_2/benchmark/other-lang/fib.rb
deleted file mode 100644
index ec587eabe0..0000000000
--- a/ruby_2_2/benchmark/other-lang/fib.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def fib n
- if n < 3
- 1
- else
- fib(n-1) + fib(n-2)
- end
-end
-
-fib(34)
diff --git a/ruby_2_2/benchmark/other-lang/fib.scm b/ruby_2_2/benchmark/other-lang/fib.scm
deleted file mode 100644
index 2fc4e225bd..0000000000
--- a/ruby_2_2/benchmark/other-lang/fib.scm
+++ /dev/null
@@ -1,7 +0,0 @@
-(define (fib n)
- (if (< n 3)
- 1
- (+ (fib (- n 1)) (fib (- n 2)))))
-
-(fib 34)
-
diff --git a/ruby_2_2/benchmark/other-lang/loop.pl b/ruby_2_2/benchmark/other-lang/loop.pl
deleted file mode 100644
index 2777490aaa..0000000000
--- a/ruby_2_2/benchmark/other-lang/loop.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-for($i=0; $i<30000000; $i++){
-}
-
diff --git a/ruby_2_2/benchmark/other-lang/loop.py b/ruby_2_2/benchmark/other-lang/loop.py
deleted file mode 100644
index 003749bf3a..0000000000
--- a/ruby_2_2/benchmark/other-lang/loop.py
+++ /dev/null
@@ -1,2 +0,0 @@
-for i in xrange(30000000):
- pass
diff --git a/ruby_2_2/benchmark/other-lang/loop.rb b/ruby_2_2/benchmark/other-lang/loop.rb
deleted file mode 100644
index b367b9dbf3..0000000000
--- a/ruby_2_2/benchmark/other-lang/loop.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-i = 0
-while i<30000000
- i += 1
-end
diff --git a/ruby_2_2/benchmark/other-lang/loop.scm b/ruby_2_2/benchmark/other-lang/loop.scm
deleted file mode 100644
index 3364f7e679..0000000000
--- a/ruby_2_2/benchmark/other-lang/loop.scm
+++ /dev/null
@@ -1 +0,0 @@
-(dotimes (x 30000000))
diff --git a/ruby_2_2/benchmark/other-lang/loop2.rb b/ruby_2_2/benchmark/other-lang/loop2.rb
deleted file mode 100644
index df8fffc1ff..0000000000
--- a/ruby_2_2/benchmark/other-lang/loop2.rb
+++ /dev/null
@@ -1 +0,0 @@
-30000000.times{}
diff --git a/ruby_2_2/benchmark/other-lang/tak.pl b/ruby_2_2/benchmark/other-lang/tak.pl
deleted file mode 100644
index 7e748a67c6..0000000000
--- a/ruby_2_2/benchmark/other-lang/tak.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-sub tak {
- local($x, $y, $z) = @_;
- if (!($y < $x)) {
- return $z;
- } else {
- return &tak(&tak($x - 1, $y, $z),
- &tak($y - 1, $z, $x),
- &tak($z - 1, $x, $y));
- }
-}
-&tak(18, 9, 0);
diff --git a/ruby_2_2/benchmark/other-lang/tak.py b/ruby_2_2/benchmark/other-lang/tak.py
deleted file mode 100644
index 04f3f6829c..0000000000
--- a/ruby_2_2/benchmark/other-lang/tak.py
+++ /dev/null
@@ -1,8 +0,0 @@
-def tak(x, y, z):
- if not(y<x):
- return z
- else:
- return tak(tak(x-1, y, z),
- tak(y-1, z, x),
- tak(z-1, x, y))
-tak(18, 9, 0)
diff --git a/ruby_2_2/benchmark/other-lang/tak.rb b/ruby_2_2/benchmark/other-lang/tak.rb
deleted file mode 100644
index efe5380f4e..0000000000
--- a/ruby_2_2/benchmark/other-lang/tak.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-
-def tak x, y, z
- unless y < x
- z
- else
- tak( tak(x-1, y, z),
- tak(y-1, z, x),
- tak(z-1, x, y))
- end
-end
-
-tak(18, 9, 0)
-
diff --git a/ruby_2_2/benchmark/other-lang/tak.scm b/ruby_2_2/benchmark/other-lang/tak.scm
deleted file mode 100644
index 52a7629ee5..0000000000
--- a/ruby_2_2/benchmark/other-lang/tak.scm
+++ /dev/null
@@ -1,10 +0,0 @@
-(define (tak x y z)
- (if (not (< y x))
- z
- (tak (tak (- x 1) y z)
- (tak (- y 1) z x)
- (tak (- z 1) x y))))
-
-(tak 18 9 0)
-
-