Create a gist now

Instantly share code, notes, and snippets.

perl6 vs. perl5 - simple loop
[ perl6() ] cd ~/devel/perl6
[ perl6() ] git clone git@github.com:rakudo/rakudo.git
...
[ perl6() ] cd rakudo
[ perl6() ] perl Configure.pl --backends=moar --gen-moar=master --moar-option="--enable-jit" --gen-nqp=master
...
[ perl6() ] make
...
[ perl6() ] make install
...
[ perl6() ] perl -v | head -n2 | tail -n1
This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-thread-multi
[ perl6() ] perl6 -v
This is perl6 version 2014.07-152-ge822cca built on MoarVM version 2014.07-365-g29d2e7b
[ perl6() ] time perl -e 'my $i = 0; while (($i = $i + 1) <= 100000000) { }'
real 0m4.219s
user 0m4.211s
sys 0m0.000s
[ perl6() ] time perl -e 'use integer; my $i = 0; while (($i = $i + 1) <= 100000000) { }'
real 0m3.845s
user 0m3.838s
sys 0m0.001s
[ perl6() ] time MVM_JIT_DISABLE=1 perl6 -e 'my int $i = 0; while ($i = $i + 1) <= 100000000 { }'
real 0m2.937s
user 0m2.900s
sys 0m0.033s
[ perl6() ] time perl6 -e 'my int $i = 0; while ($i = $i + 1) <= 100000000 { }'
real 0m0.711s
user 0m0.672s
sys 0m0.036s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment