develooper Front page | perl.perl6.internals | Postings from February 2006

Re: Heureka - from the -Ofun department

Thread Previous | Thread Next
From:
Andy Dougherty
Date:
February 10, 2006 09:33
Subject:
Re: Heureka - from the -Ofun department
Message ID:
Pine.SOC.4.62.0602101224010.23125@maxwell.phys.lafayette.edu
On Wed, 8 Feb 2006, Leopold Toetsch wrote:

> Parrot runs the ackermann benchmark faster than C.
> 
> $ time ./parrot -Oc -C ack.pir 11
> Ack(3, 11) = 16381
> 
> real    0m0.567s
> user    0m0.559s
> sys     0m0.008s
> 
> $ time ./ack 11
> Ack(3,11): 16381
> 
> real    0m0.980s
> user    0m0.978s
> sys     0m0.002s

This looked like fun, so I tried it on Solaris/SPARC.  Alas, I didn't
have such great luck.  First, though the -C runcore made about a factor
of 2 difference in timings (gcc/SPARC), it's only only available (as
far as I can tell) with gcc.   Still, you might as well use it if you
can.

On SPARC, I found Parrot took 12 times as long:

C:  time ./ack 11
    Ack(3,11): 16381

    real    1m7.62s
    user    1m7.36s
    sys     0m0.05s

Parrot:  time ./parrot -Oc -C ack.pir 11
    Ack(3, 11) = 16381

    real    11m56.24s
    user    11m52.12s
    sys     0m0.14s


Thinking it might have something to do with the SPARC architecture,
I tried it on x86, where Parrot took 80 times as long:

C:  time ./ack 11
    Ack(3,11): 16381

    real    0m0.759s
    user    0m0.758s
    sys     0m0.002s

Parrot:  time ./parrot -Oc -C ../tmp/ack.pir 11
    Ack(3, 11) = 16381

    real    1m1.211s
    user    1m1.087s
    sys     0m0.021s

Something's obviously very goofy there, but I don't know what.

-- 
    Andy Dougherty		doughera@lafayette.edu

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About