Hello.

Here I declare vict^W good start.

ba...@icering:~/src/parrot$ time ./parrot --gc ms ext/nqp-rx/nqp-rx.pbc fib2.nqp
Got grabage 1000000
fib(28) = 317811

real    0m12.887s
user    0m12.333s
sys     0m0.528s

ba...@icering:~/src/parrot$ time ./parrot --gc boehm ext/nqp-rx/nqp-rx.pbc fib2.nqp
Got grabage 1000000
fib(28) = 317811

real    0m9.509s
user    0m9.445s
sys     0m0.048s


fib2.nqp is

sub fib($n) {
    ($n < 2) ?? $n !! fib($n-1) + fib($n-2);
}

my $N := 28;

# Generate some long-lived garbage
my @garbage;
my $i := 1000000;
repeat {
    @garbage.push($i);
    $i--;
} while $i > 0;

pir::say("Got grabage " ~ +...@garbage);

pir::say("fib($N) = " ~ fib($N));


Basically it's original fib.nqp from pmichaud's mail + a lot of garbage.

--
Bacek.
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to