$ perl ./tools/dev/parrotbench.pl -c ../parrot_bench.conf -b vpm\$ Numbers are relative to the first one. (lower is better) p p-j p-C p5.5 p5.8 py rb vpm 100% 88% 99% 46% 91% - 58%
Attached is the missing python vpm, and a couple of other fillers. Mitchell
diff -urN /b/CVSes/parrot/parrot/examples/benchmarks/fib.py ./examples/benchmarks/fib.py --- /b/CVSes/parrot/parrot/examples/benchmarks/fib.py Wed Dec 31 19:00:00 1969 +++ ./examples/benchmarks/fib.py Mon Mar 15 18:16:49 2004 @@ -0,0 +1,12 @@ +#! python + +import sys + +def fib(n): + if (n < 2): + return(n) + return( fib(n-2) + fib(n-1) ) + +N = int(len(sys.argv) == 2 and sys.argv[1] or 24) + +print "fib(%d) = %d" %( N, fib(N) ) diff -urN /b/CVSes/parrot/parrot/examples/benchmarks/primes2.pl ./examples/benchmarks/primes2.pl --- /b/CVSes/parrot/parrot/examples/benchmarks/primes2.pl Wed Dec 31 19:00:00 1969 +++ ./examples/benchmarks/primes2.pl Mon Mar 15 17:26:00 2004 @@ -0,0 +1,35 @@ +#! perl + +my $i=0; +my $max=5000; +my $i6 = 0; +my $i7; + +while (1) { + if (&isprime1($i)) { + $i7 = $i; + $i6++; + } + $i++; + if ($i==$max){ + last; + } +} +printf("N primes calculated to %d is %d\nlast is: %d\n",$max,$i6,$i7); + +sub isprime1 +{ + my($input)[EMAIL PROTECTED]; + my $n; + + if ($input < 1) { + return 0; + } + $n = $input - 1; + + while ($n > 1){ + if ($input % $n == 0) { return 0; } + $n--; + } + return 1; +} diff -urN /b/CVSes/parrot/parrot/examples/benchmarks/vpm.py ./examples/benchmarks/vpm.py --- /b/CVSes/parrot/parrot/examples/benchmarks/vpm.py Wed Dec 31 19:00:00 1969 +++ ./examples/benchmarks/vpm.py Mon Mar 15 18:02:36 2004 @@ -0,0 +1,16 @@ +#! python + +import string + +big = 0 +astring = "just another pyth hacker" + +for i in range(100000): + big = big + 1 + str = list(astring) + f = str.pop(0) + str.append(f) + astring = string.join(str,"") + +print big +print astring