Hi,

there was some benchmarking and discussion about perl5 slowness in ...
http://groups.google.at/group/perl.perl5.porters/browse_thread/thread/4ad7f6edacc97e1b/75af8abf89420f8c?hl=de&;
... and of course there were some remarks re parrot.

I'm not subscribed to p5p, so feel free to forward the message.

Here are the numbers[1] for that mentioned benchmark[2]:

$ time perl mandel.pl >/dev/null && time ./parrot -j mandel.pir >/dev/null && 
time ./mandel >/dev/null

real    0m3.314s
user    0m3.300s
sys     0m0.004s

real    0m0.084s
user    0m0.084s
sys     0m0.000s

real    0m0.029s
user    0m0.024s
sys     0m0.000s

leo

[1] on AMD [EMAIL PROTECTED], optimized parrot build of r27216 (-m32 --optimize)
[2] perl and C code from 
http://www.timestretch.com/FractalBenchmark.html#4d9e0f15fc1b42420cf3f778c3cccad7
perl 5.8.8, C 4.1.0 (C compiled w/ -O3), optimized parrot build of r27216 
(-m32 --optimize)

parrot code is here:

$ cat mandel.pir
.const int BAILOUT        =   16
.const int MAX_ITERATIONS = 1000
.sub mandelbrot
    .param num x
    .param num y
    .local num cr, ci, zr, zi
    .local int i
    cr = y - 0.5
    ci = x
    zi = 0.0
    zr = 0.0
    i  = 0
loop:
    inc i
    .local num temp, zr2, zi2
    temp = zr * zi
    zr2  = zr * zr
    zi2  = zi * zi
    zr   = zr2 - zi2
    zr  += cr
    zi   = temp + temp
    zi  += ci
    $N0  = zi2 + zr2
    if $N0 > BAILOUT goto ret
    if i   > MAX_ITERATIONS goto ret0
    goto loop
ret:
    .return (i)
ret0:
    .return (0)
.end
.sub main :main
    .local num start, end
    start = time
    .local int x, y
    y = -39
loopy:
    if y >= 39 goto endy
    print "\n"
        x = -39
    loopx:
        if x >= 39 goto endx
        .local int i
        $N0 = x / 40
        $N1 = y / 40
        i = mandelbrot($N0, $N1)
        if i == 0 goto pstar
            print ' '
            goto pdone
    pstar:
            print '*'
    pdone:
        inc x
        goto loopx
    endx:
    inc y
    goto loopy
endy:
    end = time
    $N2 = end - start
    $P0 = new 'ResizablePMCArray'
    push $P0, $N2
    $S0 = sprintf "\nParrot Elapsed %0.2f\n", $P0
    print $S0
.end

Reply via email to