Created
June 1, 2012 21:26
-
-
Save anonymous/2855224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pmichaud@kiwi:~/p6/rakudo-qrpa$ cat z2.pir | |
.loadlib 'src/pmc/perl6_group' | |
.sub 'main' :main | |
.local pmc p, q | |
p = new "ResizablePMCArray" | |
q = new "QRPA" | |
$P0 = box 'abc' | |
p[$I0] = $P0 | |
q[$I0] = $P0 | |
.local int N | |
N = 20000000 | |
print " rpa[$I0] = " | |
'time_lookup'(p, N) | |
print "qrpa[$I0] = " | |
'time_lookup'(q, N) | |
.end | |
.sub 'time_lookup' | |
.param pmc p | |
.param int N | |
.local num t0, t1 | |
$I0 = 0 | |
t0 = time | |
loop1: | |
unless N > 0 goto done1 | |
# noop | |
$P0 = p[$I0] | |
dec N | |
goto loop1 | |
done1: | |
t1 = time | |
$N0 = t1 - t0 | |
say $N0 | |
.end | |
pmichaud@kiwi:~/p6/rakudo-qrpa$ install/bin/parrot z2.pir | |
rpa[$I0] = 0.651993989944458 | |
qrpa[$I0] = 0.776318073272705 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment