In case anyone is interested.....

On a whim I took the primes.pasm example from the parrot examples page and converted it to both c and perl5, with _interesting_ results.

Timing all three with a max of 100,000 produced the following results:

c -primes.c(lickety split):
real 0m7.710s
user 0m6.790s
sys 0m0.030s

parrot primes.pasm(default options not too impressive):
real 0m33.289s
user 0m29.130s
sys 0m0.080s

parrot primes.pasm(with -P...a bit better)
real 0m21.063s
user 0m20.000s
sys 0m0.050s

parrot primes.pasm (with jit -j option--omfg...i'm impressed)
real 0m12.625s
user 0m11.610s
sys 0m0.040s

perl5 primes.pl(ouch!!!!!!!!!, yes...this is the same algorithm)
real 6m53.454s
user 6m33.490s
sys 0m0.990s

FYI...all three used the identical algorithm taken from the primes.pasm example complete with labels and gotos(makes for very disconcerting perl code). Startup times and printf times were not significant in any of the cases(<5%).

Further curious because of the python challenge, I took a different (slower) primes algorithm(trying to be fair to python since it doesn't have gotos), That someone had already written C and python versions of, and ported it to parrot....drum roll please(only 10,000 primes due to slower algorithm):

c - primes2.c
real 0m1.147s
user 0m1.050s
sys 0m0.000s

parrot primes2.pasm(default)
real 0m4.868s
user 0m4.700s
sys 0m0.020s

parrot primes2.pasm(-P)
real 0m3.058s
user 0m2.920s
sys 0m0.000s

parrot primes2.pasm(-J)
real 0m1.825s
user 0m1.700s
sys 0m0.000s

python primes2.py
real 0m25.922s
user 0m24.900s
sys 0m0.050s


So at least on simple looping benchmarks like this, parrot is much closer to the performance of C than it is to perl or python...I liiiike it (doing my best Tony the Tiger impersonation here). Congrats guys...it's pretty impressive.

Testing platform is linux debian (sid) on an Athlon 2100, gcc 3.2.3, perl 5.8.0, python 2.2.2, and parrot CVS head as of today.

-Tupshin

Code available if anybody cares.

Reply via email to