ps
1803 root 300 S time./parrot examples/benchmarks/primes2.pasm
1804 root 4476 R ./parrot examples/benchmarks/primes2.pasm
1805 root 4476 S ./parrot examples/benchmarks/primes2.pasm
1806 root 4476 S ./parrot examples/benchmarks/primes2.pasm
1807 root 4476 S ./parrot examples/benchmarks/primes2.pasm
root@tinypxa263:/var/tmp/parrot-0.3.0# time
./parrot examples/benchmarks/primes2.pasm
N primes calculated to 5000 is 670
last is: 4999
57.10user 33.41system 1:31.05elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Perl 5.8.4:
ps
1817 root 300 S time perl examples/benchmarks/primes2.pl
1818 root 1672 R perl examples/benchmarks/primes2.pl
root@tinypxa263:/var/tmp/parrot-0.3.0# time perl examples/benchmarks/primes2.pl
N primes calculated to 5000 is 670
last is: 4999
76.65user 109.20system 3:06.27elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
C compiled:
root@tinypxa263:/var/tmp/parrot-0.3.0/examples/benchmarks# gcc primes2.c -o primes2
time root@tinypxa263:/var/tmp/parrot-0.3.0/examples/benchmarks# time primes2
N primes calculated to 10000 is 1230
last is: 9973
13.53user 0.03system 0:13.57elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
bad polly! no cookie! (Score:2)
And you used only a single space in each.
Suggestion: run the test for spaces 1e4, 2e4, and 3e4 for all three languages. Then we can do some comparisons.
For additional bonus bring in Python and Ruby, maybe even Java.
For additional additional bonus, do not compare only running times but also memory use and "executable" (whatever that means for each language) sizes.
Re:bad polly! no cookie! (Score:1)